fix: fix CI failures - gradlew permission and Go formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
643aa0d47c
commit
d9279c08cc
6 changed files with 15 additions and 16 deletions
0
android/gradlew
vendored
Normal file → Executable file
0
android/gradlew
vendored
Normal file → Executable file
|
|
@ -11,9 +11,9 @@ type rateLimiter struct {
|
|||
maxToolCallsPerMinute int
|
||||
maxRequestsPerMinute int
|
||||
|
||||
mu sync.Mutex
|
||||
toolCallTimes []time.Time
|
||||
requestTimes []time.Time
|
||||
mu sync.Mutex
|
||||
toolCallTimes []time.Time
|
||||
requestTimes []time.Time
|
||||
}
|
||||
|
||||
func newRateLimiter(maxToolCalls, maxRequests int) *rateLimiter {
|
||||
|
|
|
|||
|
|
@ -263,4 +263,3 @@ func (c *WebSocketChannel) readPump(conn *websocket.Conn, clientID, chatID strin
|
|||
c.HandleMessage(senderID, chatID, content, media, metadata)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ func TestExecuteHeartbeat_Async(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||
|
||||
asyncCalled := false
|
||||
|
|
@ -54,7 +54,7 @@ func TestExecuteHeartbeat_Error(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||
|
||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||
|
|
@ -92,7 +92,7 @@ func TestExecuteHeartbeat_Silent(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||
|
||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||
|
|
@ -130,7 +130,7 @@ func TestHeartbeatService_StartStop(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,1, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 1, true)
|
||||
|
||||
err = hs.Start()
|
||||
if err != nil {
|
||||
|
|
@ -149,7 +149,7 @@ func TestHeartbeatService_Disabled(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,1, false)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 1, false)
|
||||
|
||||
if hs.enabled != false {
|
||||
t.Error("Expected service to be disabled")
|
||||
|
|
@ -166,7 +166,7 @@ func TestExecuteHeartbeat_NilResult(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||
|
||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||
|
|
@ -188,7 +188,7 @@ func TestLogPath(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||
|
||||
// Write a log entry
|
||||
hs.log("INFO", "Test log entry")
|
||||
|
|
@ -208,7 +208,7 @@ func TestHeartbeatFilePath(t *testing.T) {
|
|||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
||||
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||
|
||||
// Trigger default template creation
|
||||
hs.buildPrompt()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import (
|
|||
// ServerInstance manages a connected MCP server session.
|
||||
type ServerInstance struct {
|
||||
session *sdkmcp.ClientSession
|
||||
done chan struct{} // closed when session ends; created once per session
|
||||
done chan struct{} // closed when session ends; created once per session
|
||||
tools []*sdkmcp.Tool
|
||||
lastUsed time.Time
|
||||
crashes []time.Time // track crash times for rate limiting
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ func EncodeFileToDataURL(path string) string {
|
|||
}
|
||||
if info.Size() > maxImageFileSize {
|
||||
logger.WarnCF("media", "Image file too large, skipping", map[string]interface{}{
|
||||
"path": path,
|
||||
"size_mb": info.Size() / (1024 * 1024),
|
||||
"max_mb": maxImageFileSize / (1024 * 1024),
|
||||
"path": path,
|
||||
"size_mb": info.Size() / (1024 * 1024),
|
||||
"max_mb": maxImageFileSize / (1024 * 1024),
|
||||
})
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue