picoclaw/pkg
yuchou87 f1b798434d fix(mcp): prevent race condition between CallTool and Close
Add a closed flag to the Manager struct to prevent CallTool from
accessing server connections after Close has been called. The flag
is checked within the RLock in CallTool to ensure thread-safety.

Previously, CallTool could obtain a server reference using RLock,
then that reference could be closed by Close() running concurrently,
leading to use-after-close errors. Now:

1. CallTool checks the closed flag before accessing servers
2. Close sets the closed flag before closing connections
3. CallTool directly accesses m.servers within the lock instead
   of using GetServer() to avoid releasing the lock prematurely

This ensures CallTool will not use a server connection that is
being closed or has been closed.

Addresses Copilot code review feedback.
2026-02-19 19:47:05 +08:00
..
agent improve(agent): clarify MCP tool registration logging 2026-02-19 19:31:13 +08:00
auth fix: codex agent 400 error (#102) 2026-02-16 11:46:02 +08:00
bus Prevent panic on publish after MessageBus is closed (#223) 2026-02-16 15:04:25 +08:00
channels feat(onebot): enhance OneBot channel (#192) 2026-02-19 14:39:35 +08:00
config style(config): use snake_case for EnvFile JSON field name 2026-02-19 19:43:48 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
cron fix: tighten file perms and enforce Slack ACL checks (#186) 2026-02-16 16:06:39 +08:00
devices feat: add device hotplug event notifications (USB on Linux) 2026-02-14 17:03:04 +08:00
health Add health check endpoints (/health and /ready) for container orchestration liveness and readiness probes. (#104) 2026-02-16 11:53:11 +08:00
heartbeat * fix: heartbeat/service_test.go test failed 2026-02-13 22:19:18 +08:00
logger * First commit 2026-02-09 19:20:19 +08:00
mcp fix(mcp): prevent race condition between CallTool and Close 2026-02-19 19:47:05 +08:00
migrate merge: sync upstream/main, wire WebSearch through factory 2026-02-18 11:09:18 -03:00
providers fix: also use max_completion_tokens for gpt5 era models (#445) 2026-02-19 01:29:34 +01:00
routing feat: add multi-agent routing with declarative bindings 2026-02-13 12:12:33 -03:00
session Feat issue 183 (#189) 2026-02-16 16:30:54 +08:00
skills dead code cleanup (#210) 2026-02-19 01:54:13 +01:00
state refactor(heartbeat): add configurable interval and channel-aware routing 2026-02-13 11:13:32 +08:00
tools chore: merge main branch into mcp-tools-support 2026-02-19 19:06:37 +08:00
utils Update pkg/utils/message.go 2026-02-18 23:26:39 +01:00
voice Remove duplicate truncate functions, reuse utils.Truncate 2026-02-12 00:46:48 +08:00