mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-07-28 01:27:58 +00:00
8290c72d44
Two concurrency bugs identified in PR #2904 review: 1. Replace sync.WaitGroup with sync.Cond-based activeReqCount to avoid the "WaitGroup is reused before previous Wait has returned" panic that occurs when Add(1) races with a goroutine-launched Wait(). 2. Make panic cleanup conditional: when runTurn panics, only delete the session's activeTurnStates entry if it still points to our placeholder. Previously, an unconditional delete could wipe a new message's slot claimed between the panic and the deferred cleanup.