Files
picoclaw/pkg/mcp
yuchou87 cfc29a1383 fix(mcp): prevent use-after-close race between CallTool and Close
A race could occur when Close() called conn.Session.Close() concurrently
with an in-flight conn.Session.CallTool(), leading to undefined behavior.

Fix by adding a sync.WaitGroup to Manager:
- CallTool increments the WaitGroup while holding the read lock (after
  checking m.closed), ensuring no new calls are counted after Close sets
  the flag
- Close sets m.closed=true, releases the write lock, then waits for all
  in-flight calls to finish via wg.Wait() before closing sessions
2026-02-21 14:10:48 +08:00
..
2026-02-19 18:53:24 +08:00