mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
7e9e685a141891db51624d333d20c0b0c626f283
The race condition occurred when overlapping stream() calls (e.g., during message interrupt) corrupted shared instance-level flags: - streamedAssistantTextThisTurn - streamedReasoningThisTurn This caused Turn 2 to reset flags while Turn 1 was still reading them, leading to garbled text or suppressed responses. Fix: - Created TurnContext interface to track per-turn streaming state - Moved flags from instance variables to turn-local context - Pass TurnContext through translateMessageToEvents, mapBlocksToTimeline, and mapPartialEvent call chains Also fixed: - session.ts interruptAgentIfRunning() now polls for agent to become fully idle (not just cancelled) before starting new run, matching the fix from MCP handler Test: - Added E2E test that sends overlapping messages and verifies Turn 2 responds with its own content, not Turn 1's 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Languages
TypeScript
98.1%
JavaScript
1.3%
Shell
0.1%
Swift
0.1%