Skip to content

fix(ui): isolate event stream state by run id - #1333

Merged
jayminwest merged 3 commits into
jayminwest:mainfrom
Anuppaul:fix/run-event-stream-isolation
Oct 7, 2026
Merged

jayminwest merged 3 commits into
jayminwest:mainfrom
Anuppaul:fix/run-event-stream-isolation

Conversation

@Anuppaul

@Anuppaul Anuppaul commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix useEventStream retaining the previous run's events, status, and error when React reuses the hook instance for a different runId.

  • track the run id that owns the current stream state
  • reset to an empty connecting state only when the run id changes
  • preserve accumulated history when only follow changes for the same run
  • ignore late event/status callbacks from a previous run
  • add pure helper coverage for same-run retention and cross-run reset

Closes #1325

Verification

The regression coverage is in src/ui/src/hooks/use-event-stream.helpers.test.ts and keeps the existing replay-deduplication cases unchanged.

This contribution is AI-assisted. The new regression test specifically pins the state transition that did not exist on main (new run id -> empty events/status/error). I could not run the local Bun gate from this execution environment because outbound repository cloning is unavailable, so I am relying on the repository CI check:all gates for executable verification rather than claiming a local pass.

@jayminwest
jayminwest enabled auto-merge (squash) October 7, 2026 16:32
@jayminwest
jayminwest merged commit 5276209 into jayminwest:main Oct 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run detail event tail keeps the previous run's events (and drops the new run's) when navigating between run ids

2 participants