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
|
maxToolCallsPerMinute int
|
||||||
maxRequestsPerMinute int
|
maxRequestsPerMinute int
|
||||||
|
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
toolCallTimes []time.Time
|
toolCallTimes []time.Time
|
||||||
requestTimes []time.Time
|
requestTimes []time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func newRateLimiter(maxToolCalls, maxRequests int) *rateLimiter {
|
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)
|
c.HandleMessage(senderID, chatID, content, media, metadata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ func TestExecuteHeartbeat_Async(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
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.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
asyncCalled := false
|
asyncCalled := false
|
||||||
|
|
@ -54,7 +54,7 @@ func TestExecuteHeartbeat_Error(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
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.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||||
|
|
@ -92,7 +92,7 @@ func TestExecuteHeartbeat_Silent(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
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.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||||
|
|
@ -130,7 +130,7 @@ func TestHeartbeatService_StartStop(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, tmpDir,1, true)
|
hs := NewHeartbeatService(tmpDir, tmpDir, 1, true)
|
||||||
|
|
||||||
err = hs.Start()
|
err = hs.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -149,7 +149,7 @@ func TestHeartbeatService_Disabled(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, tmpDir,1, false)
|
hs := NewHeartbeatService(tmpDir, tmpDir, 1, false)
|
||||||
|
|
||||||
if hs.enabled != false {
|
if hs.enabled != false {
|
||||||
t.Error("Expected service to be disabled")
|
t.Error("Expected service to be disabled")
|
||||||
|
|
@ -166,7 +166,7 @@ func TestExecuteHeartbeat_NilResult(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
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.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||||
|
|
@ -188,7 +188,7 @@ func TestLogPath(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||||
|
|
||||||
// Write a log entry
|
// Write a log entry
|
||||||
hs.log("INFO", "Test log entry")
|
hs.log("INFO", "Test log entry")
|
||||||
|
|
@ -208,7 +208,7 @@ func TestHeartbeatFilePath(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, tmpDir,30, true)
|
hs := NewHeartbeatService(tmpDir, tmpDir, 30, true)
|
||||||
|
|
||||||
// Trigger default template creation
|
// Trigger default template creation
|
||||||
hs.buildPrompt()
|
hs.buildPrompt()
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import (
|
||||||
// ServerInstance manages a connected MCP server session.
|
// ServerInstance manages a connected MCP server session.
|
||||||
type ServerInstance struct {
|
type ServerInstance struct {
|
||||||
session *sdkmcp.ClientSession
|
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
|
tools []*sdkmcp.Tool
|
||||||
lastUsed time.Time
|
lastUsed time.Time
|
||||||
crashes []time.Time // track crash times for rate limiting
|
crashes []time.Time // track crash times for rate limiting
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,9 @@ func EncodeFileToDataURL(path string) string {
|
||||||
}
|
}
|
||||||
if info.Size() > maxImageFileSize {
|
if info.Size() > maxImageFileSize {
|
||||||
logger.WarnCF("media", "Image file too large, skipping", map[string]interface{}{
|
logger.WarnCF("media", "Image file too large, skipping", map[string]interface{}{
|
||||||
"path": path,
|
"path": path,
|
||||||
"size_mb": info.Size() / (1024 * 1024),
|
"size_mb": info.Size() / (1024 * 1024),
|
||||||
"max_mb": maxImageFileSize / (1024 * 1024),
|
"max_mb": maxImageFileSize / (1024 * 1024),
|
||||||
})
|
})
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue