Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix: surface silent MCP load/close failures to the session

4 months ago

442a1c8
Authored
mweinbach6/9/2026, 5:25:13 PM
- runTurn now accepts onMcpLoadErrors and invokes it in both MCP load
  branches; previously the errors array was discarded, so sessions
  attaching to a workspace whose MCP servers failed (cache-hit path
  logs nothing) ran with a degraded tool set and no signal
- AgentSession turns wire onMcpLoadErrors to session log events +
  telemetry so every turn surfaces degraded MCP state to the client
- MCP close errors are now logged instead of silently swallowed
  (turn finally block, stale-cache reload, session teardown); the two
  error-cleanup close sites stay intentionally silent with comments
- clearer MCP tool-collision log message
- document the intentional unsupported-model fallback in config.ts

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Parent9cd4eae

6 files changed
  • src/agent.ts+7−3
  • src/config.ts+4−0
  • src/mcp/index.ts+9−6
  • src/server/session/turnExecution/runTurnInvocation.ts+12−0
  • test/agent.test.ts+53−1
  • test/mcp.cache.test.ts+60−0