Skip to content

Stop disposed transcript reads from updating terminal chats - #16049

Merged
teamleaderleo merged 2 commits into
fix/cloud-transcript-file-replacementfrom
fix/cloud-transcript-tail-disposal
Sep 30, 2026
Merged

teamleaderleo merged 2 commits into
fix/cloud-transcript-file-replacementfrom
fix/cloud-transcript-tail-disposal

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

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 command bun run test/transcript-disposal.test.ts fails at 91892a70158bd258eb7ea6de2d52e884aa9eff93 with “a disposed transcript read must not emit late events” and passes at 3a5a306eac73cc2e5c56e2cfd13c7ccdf9205901.

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 check passes TypeScript and the package tests (55 Bun tests across 14 files, plus 24 standalone assertion scripts). Both production browser entrypoints bundle successfully, and git diff --check acd284567484b77fbaca6e78b6f4446da98cf72a..HEAD passes. 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.

Review in cubic

@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 95591d30-4a08-4620-9ff2-9063ab981eb4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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.

@teamleaderleo
teamleaderleo merged commit 09ab33c into fix/cloud-transcript-file-replacement Sep 30, 2026
53 checks passed
@teamleaderleo
teamleaderleo deleted the fix/cloud-transcript-tail-disposal branch September 30, 2026 15:48
teamleaderleo added a commit that referenced this pull request Sep 30, 2026
* 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
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.

1 participant