diff --git a/config/config.example.json b/config/config.example.json index 933cd58b6..804811ed8 100644 --- a/config/config.example.json +++ b/config/config.example.json @@ -314,55 +314,7 @@ "use_bm25": true, "use_regex": false }, - "servers": { - "context7": { - "enabled": false, - "type": "http", - "url": "https://mcp.context7.com/mcp", - "headers": { - "CONTEXT7_API_KEY": "ctx7sk-xx" - } - }, - "filesystem": { - "enabled": false, - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"] - }, - "github": { - "enabled": false, - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-github"], - "env": { - "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN" - } - }, - "brave-search": { - "enabled": false, - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-brave-search"], - "env": { - "BRAVE_API_KEY": "YOUR_BRAVE_API_KEY" - } - }, - "postgres": { - "enabled": false, - "command": "npx", - "args": [ - "-y", - "@modelcontextprotocol/server-postgres", - "postgresql://user:password@localhost/dbname" - ] - }, - "slack": { - "enabled": false, - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-slack"], - "env": { - "SLACK_BOT_TOKEN": "YOUR_SLACK_BOT_TOKEN", - "SLACK_TEAM_ID": "YOUR_SLACK_TEAM_ID" - } - } - } + "servers": {} }, "exec": { "enabled": true, diff --git a/config/config.json.azure b/config/config.json.azure index 9a7ff3397..747991a3d 100644 --- a/config/config.json.azure +++ b/config/config.json.azure @@ -476,14 +476,7 @@ "interval_minutes": 5 }, "mcp": { - "enabled": true, - "discovery": { - "enabled": false, - "ttl": 5, - "max_search_results": 5, - "use_bm25": true, - "use_regex": false - }, + "enabled": false, "servers": {} }, "whitelist": [ @@ -496,9 +489,7 @@ "append_file", "message", "weather", - "summarize", - "github", - "search_tool" + "summarize" ], "whitelist_enabled": true, "append_file": { diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index b91d2db0d..e9aaa4f9b 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -529,6 +529,23 @@ func (al *AgentLoop) Run(ctx context.Context) error { // Process message func() { + defer func() { + // We've moved InvokeTypingStop to the end of the turn (runTurn) + // to ensure terminal signals match the actual turn completion. + }() + // TODO: Re-enable media cleanup after inbound media is properly consumed by the agent. + // Currently disabled because files are deleted before the LLM can access their content. + // defer func() { + // if al.mediaStore != nil && msg.MediaScope != "" { + // if releaseErr := al.mediaStore.ReleaseAll(msg.MediaScope); releaseErr != nil { + // logger.WarnCF("agent", "Failed to release media", map[string]any{ + // "scope": msg.MediaScope, + // "error": releaseErr.Error(), + // }) + // } + // } + // }() + drainCanceled := false cancelDrain := func() { if drainCanceled { @@ -559,9 +576,6 @@ func (al *AgentLoop) Run(ctx context.Context) error { if finalResponse != "" { al.PublishResponseIfNeeded(ctx, msg.Channel, msg.ChatID, finalResponse) } - if al.channelManager != nil { - al.channelManager.InvokeTypingStop(msg.Channel, msg.ChatID) - } return } @@ -622,9 +636,6 @@ func (al *AgentLoop) Run(ctx context.Context) error { if finalResponse != "" { al.PublishResponseIfNeeded(ctx, target.Channel, target.ChatID, finalResponse) } - if al.channelManager != nil { - al.channelManager.InvokeTypingStop(target.Channel, target.ChatID) - } }() } } @@ -1858,6 +1869,9 @@ func (al *AgentLoop) runTurn(ctx context.Context, ts *turnState) (turnResult, er FinalContentLen: ts.finalContentLen(), }, ) + if al.channelManager != nil { + al.channelManager.InvokeTypingStop(ts.channel, ts.chatID) + } }() al.emitEvent(