Repository navigation
fix(cmux-tui): a new owner never ends a shell the holder still runs (an adopting row re-attaches, a failed re-attach keeps the shell, only ended rows are closed) (QUIT P0) - #29997
Conversation
…ended (a row left adopting re-attaches; a terminal with no row keeps its shell) and closes a tombstoned one (QUIT P0, red)
…an adopting row re-attaches, a failed re-attach keeps the shell, the pass ends only terminals whose row ended (QUIT P0) Lead 01:2xZ: in holder mode the startup pass recorded a terminal ended and closed its shell when its row was not exactly Running (a previous owner that stopped mid-adoption, as in a version handoff at the app's reopen) or when its re-attach failed, and release_unclaimed_holder_terminals sent CLOSE to every holder terminal no surface re-attached, a terminal with no registry row too. Now a row left adopting re-attaches like a running one; a re-attach that fails while the holder lists the terminal keeps the row and the shell for the next start; after the pass the holder ends only terminals whose row exited or was tombstoned (the shell exited, or the person closed it).
|
Design review (DAEMON SKEW owner, for the handoff part). Not a code-review receipt; that comes separately. Read at 004297f, code only, nothing built here. The design is right for the version handoff:
Open items. They are follow-ups and do not hold this PR:
|
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cmux-tui/crates/cmux-tui-core/src/mux/holder_adoption.rs">
<violation number="1" location="cmux-tui/crates/cmux-tui-core/src/mux/holder_adoption.rs:82">
P1: `is_ok_and` turns a holder-service lookup error into `held == false`; the subsequent adoption error then falls through to `mark_terminal_ended`, potentially ending a shell the holder still runs. Treat lookup failure as unknown and retain the row.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| }; | ||
| crate::holder_runtime::HolderService::may_run(host_root) | ||
| && crate::holder_runtime::HolderService::for_root(host_root) | ||
| .is_ok_and(|service| service.lists(id.as_bytes())) |
There was a problem hiding this comment.
P1: is_ok_and turns a holder-service lookup error into held == false; the subsequent adoption error then falls through to mark_terminal_ended, potentially ending a shell the holder still runs. Treat lookup failure as unknown and retain the row.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At cmux-tui/crates/cmux-tui-core/src/mux/holder_adoption.rs, line 82:
<comment>`is_ok_and` turns a holder-service lookup error into `held == false`; the subsequent adoption error then falls through to `mark_terminal_ended`, potentially ending a shell the holder still runs. Treat lookup failure as unknown and retain the row.</comment>
<file context>
@@ -41,17 +63,47 @@ impl Mux {
+ };
+ crate::holder_runtime::HolderService::may_run(host_root)
+ && crate::holder_runtime::HolderService::for_root(host_root)
+ .is_ok_and(|service| service.lists(id.as_bytes()))
+ }
+
</file context>
| .is_ok_and(|service| service.lists(id.as_bytes())) | |
| .map_or(true, |service| service.lists(id.as_bytes())) |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on cba94d5 to compare; do not merge until green; see lane-rules Shipped in:
|
…the other (a registry row cannot be deleted under its foreign keys: green step 8cfd3f5a failed at that set-up, FOREIGN KEY constraint failed)
Bugbot needs on-demand usage enabledBugbot 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. |
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Review (claude-review-subagent-29997): FIX at 457f76f I read the code only. I did not build or run anything. Scope: Blocking
Checked and correct
Non-blocking
|
…er (detach, not close) and keeps the row only while it is still running or adopting; the test file keeps one copy of each helper (review FIX on #29997)
Bugbot needs on-demand usage enabledBugbot 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. |
|
Check classification (author): the clippy step 6298c55e7fe041d7e44d0356 stopped at a base red, acpmux/src/hub/processes.rs:256 redundant closure (not in this diff; from feat base autofix 704abda). Its fix is #29995. Holder green at cc4b006: step 7d7f0cd255c5c7ad5dcd5579 (aws-m4pro-9) passed both new holder tests. |
|
Review (claude-review-subagent-29997): SHIP at cc4b006 I read the code only. I did not build or run anything. Scope: Earlier blocking findings: fixed
Checked again (unchanged from the first round, still correct)
Non-blocking (follow-ups; none holds this PR)
|
|
Check classification at cc4b006 (author):
|
|
Found 1 test failure on Blacksmith runners: Failure
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What
QUIT P0 (Lawrence 2026-11-01: "after quitting and reopening, i lose all the workspaces and terminals"). In holder mode (
cmux-tui __holder, on every channel), a new owner's startup pass ended the person's shell in two cases:running(a previous owner that stopped mid-adoption: a version handoff at the app's reopen, a crash) was recorded ended (adopt_from_holder_or_end), and thenrelease_unclaimed_holder_terminalssent CLOSE (2 s hang-up) to EVERY holder terminal no surface re-attached, a terminal with no registry row too. A failed re-attach ended the shell the same way.Now:
adoptingre-attaches like a running one.PendingTerminal::Adopting), not a live terminal that takes no input. The next start re-attaches it (the failed attach already took the holder's listed entry, so this process cannot retry it).Tests (red first, fleet cargo on macOS,
scripts/ci/cmux-tui-rust-check.sh test <filter>)holder_terminals a_restart_reattaches_a_holder_terminal_whose_row_was_left_adopting(2 holdercatterminals, SIGKILL the daemon, set one rowadopting, restart: both shells kept by pid, screens kept, input works).holder_terminals a_restart_closes_only_holder_terminals_whose_row_ended(a tombstoned row's shell is closed; a terminal with no registry row keeps its shell).a_restart_reattaches_a_holder_terminal_whose_row_was_left_adoptingPASS,a_restart_closes_a_holder_terminal_whose_row_was_tombstoned_and_keeps_the_restPASS, all holder_terminals PASS; one acpmux test (durable_agents restart_reattach) failed once and passed on its rerun, not in this diff. Compile-check of cc4b006: 1e94d277757362b79298f099 passed (CmuxNext, app, cmux-tui).cmux-tui-rust-check summary (mode clippy): clippy pass).Risk
risk:high(lead 01:2xZ): this decides whether a person's running shell ends at a daemon start. Kept shells are user data. Needs an independent review receipt at the exact head and a green compile of the head.Owners
PL-daemon holder (plans/cmux-next/pty-holder.md): told in STATUS. DAEMON SKEW owner (a619d54a5cbae4d7d) read the diff: no conflict with its host-mode design.
Changelog
Observed / Not run
Open follow-ups (DAEMON SKEW design review)