Repository navigation
Keep closed browser, editor, and proven terminal tabs out of the host list - #27565
brennanb2025 wants to merge 4 commits into
Conversation
… list Before: when a phone or paired desktop closed a terminal, browser or editor tab that the desktop window owns, the host asked the window to close it and answered "closed", but its own tab list kept the tab until the window's next publish. A per-client "closed tab" filter hid it from the client meanwhile. Now the host drops the tab from its list when the close commits: - terminal tabs closed through the acknowledged window relay are retired with retirement proofs captured before the relay (the window kills the PTYs during it); a tab with any surface lacking a proof is left for the window's own republish, and stale-terminal refusals retire nothing; - relayed browser and editor tabs are retired once the window answers. The per-client filter now covers only panes closed from a client: the window drops a pane on an unacknowledged notice, so the host still lists it until the window republishes. Selection cleanup and its revision bump are unchanged.
…ves the host list Review round 1 follow-ups for the host-side close commit: - A chat, browser or editor tab leaving the host list now repairs groups the way a terminal retirement does: a group it leaves empty is dropped with its layout leaf, and the active tab and group move to ones that still exist. - When the window's own frame already dropped a closed terminal tab before it acknowledged the close, the proofs captured before the relay still ship, so paired desktops can retire the tab instead of treating it as an orphan. - The relayed browser/editor close and the terminal list retirement live in files named for them. - Tests: a split terminal with one unproven pane retires nothing; the terminal path keeps the publication epoch; a bystander client's projected version stays monotonic across a close.
|
Closing a tab from a phone or paired desktop could leave it in the host’s published list, allowing a later update to bring it back. This PR removes accepted browser/editor closes and terminal closes with complete pane evidence from that source list, while repairing selection, groups, layouts, and recent-tab history. Source review is complete at Fixed during the loop: incomplete-proof terminal closes returning for already registered bystander clients; sibling panes remaining hidden after reopening; surviving browser groups losing their supported identifiers; and a live-close refusal omitting its existing republication marker. The description now states the filter’s actual scope and the incomplete-proof/pane exceptions. Verified: 66 final focused tests, Node typecheck, 23 static source checks, the layout-writer gate for PR-changed files, and all 13 non-skipped CI checks. Final-commit Mac checks closed a busy terminal and a real native Claude chat from the second desktop; both stayed absent at the sampled eight-second check and after reconnect, with survivors preserved. Linux SSH checks covered second-client editor removal and busy-terminal removal on the shared execution runtime, including the remote job stopping. Before/after images are in the PR body. Deferred: the hub-paired desktop’s stale SSH terminal mirror reproduced identically on the merge base and PR head. The shared-SSH setup also needed a workaround for existing pairing-identity bookkeeping. Unverified: busy SSH chat without a signed-in agent, the client-hosted SSH browser close, live Windows behavior, the exact 1M structured-native variant (the live test used the supported Opus alias), and every transition frame. The sampled chat close passed; transcript-scroll checks are not evidence for tab-strip position. Chat position is covered by the host characterization test. End-to-end and cross-version CI jobs were skipped; the local aggregate Bun command was unsupported, while Node and CI typechecks passed. Owned rig apps stopped; both remote |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No concrete issue remains that blocks merging. The unverified environments still warrant the planned validation. Pre-merge checks ·
|
ELI5
A tab closed from a phone or paired desktop could come back because the background process still included it in the next tab list. After an accepted browser/editor close, or a terminal close with enough recorded evidence, that process now removes the tab before answering. Other clients receive the updated list.
What Changed
Previously, a filter hid completed closes for clients while the underlying list could still name the tab. The filter applied to every already registered client with state for that workspace, including bystanders.
The host, the background process publishing workspace tabs, now updates its own list after the window accepts a browser or editor close. For a whole terminal tab, it first records the exact identity of every pane. Those records let paired desktops recognize intentional retirement without treating a missing row as evidence that a remote process died. The host removes the terminal only when every listed pane has matching evidence; a declined close removes nothing.
The existing removal functions repair groups, split layouts, active selection, and recent-tab history while preserving survivor order. Terminal removal now recognizes both supported browser identifiers, preventing an unrelated browser group from collapsing. Existing chat placement is preserved while a close is in progress.
Review also corrected a refusal response: when rejecting an absent-surface close republishes its live parent, the existing optional republication marker is now truthful. A refusal that sends no replacement list leaves the marker absent.
Why
Updating the published source list makes a completed close consistent for readers that do not use the client filter. Reusing the existing terminal evidence preserves execution ownership and mixed-version recovery without adding a durable closing flag or a new protocol.
The filter still covers all already registered workspace clients and clears on omission, activation, or client/workspace cleanup. This PR does not guarantee immediate underlying-list omission for incomplete terminal closes, individual panes, new client identities, or restarts.
Linked Issue
Follow-up to #27205 and the tab-close lifecycle work.
Visual Proof
Final-commit native-chat check: the owner desktop shows a real Claude chat running
sleep 120, second of four strip tabs. Eight seconds after the paired desktop closed it, the chat was absent on both; three survivors kept their order through reconnect. These sampled states do not establish every transition frame. The native test used the supported Opus alias; the exact 1M structured-native variant was not verified.Mac native busy chat close
Final-commit Mac paired-desktop check: the second desktop confirmed stopping busy Terminal 2. Both clients retained Terminal 1 and omitted Terminal 2 after eight seconds and after reconnect/refetch.
Mac paired desktop busy-terminal close
Final-commit Linux SSH host before/after: the editor close from the second hub-paired desktop removed README.md, and the subsequent busy-terminal close removed one terminal while the remaining strip order stayed intact. The selected browser shows an existing unavailable-server state; these images prove strip membership, not browser functionality. Saved runtime results separately prove the remote job stopped.
Final SHA SSH close evidence
The final image is the owner desktop after a second desktop connected to the same SSH runtime closed the busy terminal. Both clients’ saved tab snapshots omitted that terminal; a second-client screenshot was unavailable. The shared-runtime setup needed the pairing-identity workaround described under Testing.
Testing
Final commit: 3c6fb11.
bun checkcommand; the Node compiler check and CI typechecks passed.sleep 120removed it from both at the sampled three/eight-second checks and through reconnect; three survivors kept their order.Review
Completed independent correctness and architecture reviews, an architecture re-challenge, fresh review of the final correction, and the readiness checklist. The architecture verdict was to keep the design. Review fixed registered-bystander return with incomplete evidence, hidden sibling panes after reopening, surviving browser group identities, and the refusal republication marker.
Agent skill upstream boundary
Notes
No new required wire field, stream opcode, persisted schema, dependency, platform branch, or Git command. SSH and folder workspaces were considered in source review; live execution evidence is listed separately above. This PR stays a draft.
Checklist
QA ran in top-level
qa-pr-27565worktrees on the remote machines, with evidence kept outside Git. Owned rig apps were stopped and both remote QA worktrees were removed through Orca. The Linux coordination server is preserved because another PR has a live terminal on it.