picoclaw/pkg/agent
yinwm 78aba700d5 fix(mcp): resolve TOCTOU race condition and resource leak
- Use atomic.Bool for closed flag to prevent TOCTOU race between
  CallTool and Close operations
- Add double-check pattern in CallTool for thread-safe closed state
- Use atomic Swap in Close to ensure no new calls can start after
  closed flag is set
- Move MCP manager cleanup defer before initialization to handle
  partial initialization failures
- Update tests to use atomic.Bool operations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:47:25 +08:00
..
context.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00
context_cache_test.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00
context_test.go fix: handle multi-tool-call orphan detection in sanitizeHistoryForProvider 2026-02-24 21:35:15 +08:00
instance.go fix(tools): allow /dev/null redirection and add read/write sandbox split (#967) 2026-03-02 12:22:02 +08:00
instance_test.go enable dupl check 2026-03-01 18:17:32 +11:00
loop.go fix(mcp): resolve TOCTOU race condition and resource leak 2026-03-03 00:47:25 +08:00
loop_test.go Merge pull request #535 from xiaket/ci-enable-dupl-linter 2026-03-02 18:55:35 +08:00
memory.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00
mock_provider_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
registry.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
registry_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00