Skip to content

fix(agent-pane): fence stale provider tail writes after sign-in (#33239) - #33405

Merged
teamleaderleo merged 12 commits into
feat-cmux-nextfrom
lane/perf-tail-provider-epoch
Nov 3, 2026
Merged

teamleaderleo merged 12 commits into
feat-cmux-nextfrom
lane/perf-tail-provider-epoch

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

A pane that survives sign-out/sign-in can still hold the previous account’s JavaScript tail. Reject chat.tail writes from that old pane by capturing the cache generation when its provider is constructed. Both native transports carry the generation through their existing tail bridge. Fresh reads retain the current request-generation guard, and newly constructed providers cache normally.

Closes #33239. Builds on merged #33155; #33207 separately clears the daemon’s disk copies. Retargeted to feat-cmux-next after #33155 landed. The final base integration preserves the exact reviewed provider-fence patch and all intervening base changes. The minimal native comparison is boundary plumbing for the daemon-owned disk cache; it adds no persistence or render behavior.

Leo requested: “the text shows up right on click but the actual thing loads a second later … but it’s just text / from folders / on your machine / you should be able to simply see the text rendered instantly wherever it is” and “even for remote things it should be fast”. This completes the sign-out isolation of those persisted tails. His request supersedes the former in-memory-only tail choice, recorded by the parent change’s design update.

Accepted tradeoff: surviving local panes keep live rendering, sending and fresh reads, but cannot refill the cross-tab host-memory cache until their provider is recreated. This avoids inferring account ownership from raw/qualified session IDs or optional peer metadata. Re-arming an existing pane requires a future fresh-attach handshake contract.

Validation at d8b0cc8bf1b3ccfc7ba61e0703c0ec7fa5cd36ce: app compile passed in 95 seconds (fleet job 6daef011e78ece5f3f4e8550); all 14 ChatTailCacheTests passed (fleet step 7fd40b8688e2a3c3191acb75). Tests cover stale-provider write, forget and hover paths; new-provider writes; memory and disk reads from an old provider; and both native host routes. The test-only commit 47f57993dbcf32dad219961deb1c06e11e2fab3c fails oldProviderCannotRepostAfterSignInButCanStillRead on both stale-write and stale-hover replacement assertions (fleet step 0c16842fa84e37f3aa882a5b). The tests run without a display.

The base-only update and web-validation checks passed at the final head. The native-only patch does not route the webview suite. The independent Claude Opus 5.5 medium review passed at ad125662e9adc8a3dc5609e9c2b0f908397c5aea; final-head review carry is pending. The patch against the updated base is byte-identical to that reviewed delta after removing only blob-ID index lines.

Performance

Metric Before After Delta Harness/run link
Chat-switch latency Unchanged by write-fence cleanup Unchanged No render-path change Instant-switch measurement: https://github.com/manaflow-ai/cmuxterm-hq/issues/6338

Shared mock scene: agent-pane.peer-copy / cold-long-chat-connecting in PeerCopyBanner.gallery.ts renders the bounded tail of a long remote chat while its handshake remains pending. The parent early-tail rendering change owns its capture and switch measurements. This follow-up changes cache write acceptance only, with no visible UI state.

🤖 Generated with Codex

Agent session: agent session

teamleaderleo and others added 10 commits November 3, 2026 06:04
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
…ail-disk-remote

# Conflicts:
#	webviews/bench/chat-switch.bench.ts
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-683d106d63dad2af065c
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3f3e509fd95c26d1106a
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3f3e509fd95c26d1106a
@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (claude-opus-5-5 medium): SHIP at ad12566

Review (subagent claude-opus-5-5 medium): SHIP at ad12566

Visual verdict: unchanged by this diff.

Verified both providers capture an immutable generation, all chat.tail write variants reject old generations, and fresh reads retain their current lifecycle guard. No blocking findings. Fleet compile remains the owner’s check.

Follow-ups: accepted surviving-pane cache-refill tradeoff and stronger legacy WebKit-callback behavior coverage are tracked in #33239 (comment).

Base automatically changed from lane/perf-tail-disk-remote to feat-cmux-next November 3, 2026 09:53
@github-actions github-actions Bot added the risk:high Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
teamleaderleo and others added 2 commits November 3, 2026 09:58
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2513a79932be9840024d
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at d8b0cc8

Carried from the SHIP at ad12566 (review 5749196444). d8b0cc8 only merges the base twice (a848b28, then 864f4a3). git diff 864f4a3a60d d8b0cc8b is the same 136-line, +57/-5 patch across 5 files as the reviewed git diff 599d6c5d86 ad125662, apart from blob index lines.

Follow-ups: none new.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review d8b0cc8: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr33405 -f ref=lane/perf-tail-provider-epoch -f platform=macos -f backend_mode=local

Shipped in:

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41619934635 at 092736d failed: cmux-next fleet Release compile.
Those jobs last passed at 8cc02ce. This pull request is one of 5 merged since: #33578, #33567, #33411, #33407, #33405.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — d8b0cc8b Deployed Nov 3, 2026 by teamleaderleo via wait for same-key tree publisher #105360
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant