Files
picoclaw/pkg/agent
yuchou87 2318232b71 fix(agent): ensure MCP cleanup on all Run() exit paths
- Add defer in Run() to guarantee MCP connection cleanup
- Handles both normal termination and context cancellation
- Prevents resource leaks when Run() exits via ctx.Done()
- MCP Manager.Close() is idempotent, safe to call from both defer and Stop()

This fixes GitHub Copilot feedback that MCP cleanup only happened in
Stop() but Run() could return on ctx.Done() without cleanup, causing
subprocess/session leaks on normal cancellation shutdown.
2026-02-16 19:56:00 +08:00
..
2026-02-13 17:51:47 +08:00
2026-02-16 16:30:54 +08:00
2026-02-13 17:51:47 +08:00