Repository navigation
Stop disposed transcript reads from updating terminal chats - #16049
teamleaderleo merged 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review: codex review at 3a5a306 found no actionable defects; transcript tests and the disposal regression passed, with typechecking limited by missing local TypeScript dependencies. Fixed: none needed. Left: none. |
09ab33c
into
fix/cloud-transcript-file-replacement
* test: reproduce missed transcript file replacements * fix: follow atomically replaced terminal transcripts * test: cover replacement of displayed transcript history * fix: reconcile terminal history when transcript files reset * Stop disposed transcript reads from updating terminal chats (#16049) * test: reproduce late transcript events after disposal * fix: fence transcript reads after stop and disposal
Closing or redirecting a terminal chat can leave a transcript read in flight. That read can still append old events, rename the view, or update status and attention after disposal. This change fences each read to its tail lifetime and guards callbacks against the active attachment. Restarting a tail begins a new read immediately and resumes at the last committed offset.
Depends on #16045; targets its branch so this PR contains only the disposal fix and regression.
Validation
From
agent-chat, the same commandbun run test/transcript-disposal.test.tsfails at91892a70158bd258eb7ea6de2d52e884aa9eff93with “a disposed transcript read must not emit late events” and passes at3a5a306eac73cc2e5c56e2cfd13c7ccdf9205901.The fixture uses real Claude/Codex transcript files and controlled intervals. It covers disposal during a pending read, redirecting a reused session, retained status callbacks, stopping partway through a multi-chunk file, immediate restart, polling while stopped, disposal inside an event batch, and timer cleanup.
On the final commit,
bun run checkpasses TypeScript and the package tests (55 Bun tests across 14 files, plus 24 standalone assertion scripts). Both production browser entrypoints bundle successfully, andgit diff --check acd284567484b77fbaca6e78b6f4446da98cf72a..HEADpasses. No live Cloud agent was exercised.Changelog
Fixed: Closing or switching terminal chats no longer allows disposed transcript reads to update the view.
Summary by cubic
Stops disposed transcript reads from appending events, renaming views, or updating status after a terminal chat closes or redirects. In-flight reads are now fenced to the tail's current lifetime, and callbacks check the active attachment before running. Restarting a tail starts a fresh read at the last delivered offset, so restarts resume without duplicating rows.
Written for commit 3a5a306. Summary will update on new commits.