v0.6.2
Fix: Lead hangs when teammate messages interrupt active stream
When teammates finished tasks and sent messages back via promptAsync while the lead was busy (processing a tool call, spawning another teammate, etc.), the proxy would cancel the lead's active stream. The lead's current operation was lost and it hung indefinitely.
- Add busy-session guard to
team_message: checkssession.status()before callingpromptAsync. If the recipient is busy, the message is queued in the DB (delivered=0) instead of interrupting the active stream - Add
flushPendingMessageshelper: batches all pending lead-bound messages into a singlepromptAsynccall when the lead goes idle, avoiding N-1 redundant wake-ups - Add
handleLeadIdleFlushin the event hook: triggers the flush automatically on lead idle events - Revert sequential spawn guidance from v0.6.1 (no longer needed — parallel spawns are safe now)
Also in this release
- TOCTOU race between status check and delivery is documented and accepted as benign — the idle-flush backstop catches any messages that slip through
- Flush failure is non-fatal (best effort with
.catch()) so the event hook never crashes
Full Changelog: v0.6.1...v0.6.2