Skip SSE reconnect when watched run_id set is unchanged
Description
The orchestration SSE connection was being torn down and re-opened on every status transition (Idle → InProgress → Success/Cancelled/Error), even when the underlying run-id filter hadn't changed. This caused unnecessary connection churn on every exchange.
This change tracks the run-id set associated with each open SSE connection and only reconnects when that set actually changes.
Testing
- Added a regression test asserting the SSE generation does not advance across a same-set re-evaluation.
- All `orchestration_event_streamer` tests pass.
Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
CHANGELOG-BUG-FIX: Stop tearing down and re-opening the orchestration SSE connection on every exchange's status transitions.
@cephalonaut
I'm starting a first review of this pull request.
You can view the conversation on Warp.
I completed the review and no human review was requested for this pull request.
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz