You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(agentex): terminate SSE via connect-time check + terminal event, drop the poll
Collapse stream termination into two deterministic checks and remove the
recurring keepalive fallback:
- Connect-time: if the task is already terminal, replay buffered events and
end. Handles late connects deterministically (the fallback's main job).
- In-stream: end on a terminal task_updated event (unchanged).
Every real terminal transition funnels through transition_status, which emits a
task_updated, so the event path covers finishes while streaming and the
connect-time check covers finishes before subscribing. The idle branch is now
just the keepalive ping.
Removes _stream_is_finished, the StreamRepository.stream_exists port method and
its Redis impl, and the stream_ever_existed bookkeeping. This also eliminates
the 'expired key closes a live stream' edge (there is no vanished-key check
anymore): a still-running task's stream simply stays open until the client
disconnects, which is correct.
Tests updated: stream_exists assertions use redis.exists directly; the
reclaimed-key test now asserts a running stream is never closed by key
reclamation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments