Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issue was established. SummaryThis PR protects private account homes from CLI startup until the selected process exits.
|
|
Reviewed at ec1b442 against quattro 84cfb93, on a disposable Omarchy VM. The bug is real, and this fixes it. On quattro, One regression. Scope. The reproduced bug needs account resolution moved to dispatch time, plus the refusal of a managed home that is no longer registered. Both are in this PR and are small. Most of the ~290 source lines are something else: a lock file and a guardian process, forked and kept alive for every CLI session, which protect a running session whose environment no longer names its home. The tests model that with a process that re-execs itself without Tests. The account suites passed on the worker ( Second opinion. Codex Medium reviewed the same diff. It found the PATH regression above, which I then confirmed on the worker. It agreed that the startup bug is real and the guardian is unproven; independence is not guaranteed. It found no lock-ordering, descriptor or signal-handling defect. Two of its findings I did not keep. First, a race between the guardian releasing its claim and Waiting on the author for the PATH regression, and on the maintainer for whether the guardian and the two bundled changes belong here. |
|
Re-checked at ec1b442, which is unchanged since the review above, against quattro bbfdfdd. This branch no longer merges cleanly, and I took the The bug is still on quattro. Two conflicts, both mechanical.
The PATH regression from the earlier review gets worse after the merge. #14040 lets What I checked. I ran a trial merge with git on the coordinator, ran none of the code, and compared quattro's account-script changes since 84cfb93. #14099, #14100 and #14103 do not overlap with this branch's account-protection changes. No other open pull request fixes the same bug. Because the head has not moved, the earlier worker results still describe this commit. Second opinion. Codex Medium and muse-wonder (via pi, thinking high) reviewed the conflicts and the quattro changes. Both agreed on the two conflicts and how to resolve them, and that the bug is still present. Independence is not guaranteed. Both raised the #14040 interaction, which I had not caught myself, and I then confirmed it in the merged launcher. Waiting on the author to merge quattro and fix the account selection in the launcher. The question from the earlier review, whether the guardian and the two bundled changes belong in this PR, is still the maintainer's. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… on PATH order Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged current quattro (ff13cf8) and fixed the launcher (5892b6a). Two new checks in |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dropping it left decide() with no current usage, so new sessions stayed on the expired account even with a healthy one to move to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guardian drops its claim just after the CLI exits, so the add command's register could meet it and report a completed sign-in as still running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-checked at 9868831, which now merges cleanly with quattro 3b36b9e. Since the last review you merged quattro, made The classification is unsettled. The head moved, so it was classified again. Two models were asked separately, from the PR alone. Claude (Opus 5.5) called it a bug: on quattro a removed account's home is still recreated when the removal lands while a session is starting, and this PR fixes that. Codex Medium called it an enhancement. Both readings fit what the diff holds. A small part fixes the startup bug, which was reproduced earlier. Most of it adds new behaviour: the per-session guardian, expired sign-ins dropped as autoswitch destinations, and restoring a removed home when the registry save fails. Since the two models disagree, I took the Waiting on the maintainer, both to settle what this PR is and to decide whether the guardian and the two bundled changes belong here. That question from the earlier reviews is still open. |
Account dispatch now claims the selected private home before starting Claude, Codex or Grok, and keeps that claim for the exact CLI process lifetime, including startup, terminal signals, descriptor cleanup and sessions that sanitize their environment. Explicit home overrides and inherited account pins retain their existing behavior. The registry lock is held only while selecting or changing an account.
Removal takes an exclusive claim before staging a private home, saving the registry and deleting its files. Failed saves restore the home; incomplete cleanup is reported with its recovery location. Expired sign-ins are excluded from automatic switching while temporarily paused limits remain eligible.
This revision preserves current Quattro's interrupted-sign-in receipts and recovery. A failed registration retains a tracked login that can be registered on retry without another sign-in. Registration and recovery now take exclusive nonblocking claims before moving, deleting or mutating a live login, including when the original add process has exited. The legacy process-environment guard also remains active for unwrapped CLI sessions.
omarchy-agentnow hands the CLI it picked toomarchy-agent-account-execitself, passing--binaryfor a user install from #14040, so the selected account no longer depends on PATH order.omarchy-agent-account-execlooks up the provider with mise's command-wrappers directory removed from PATH, so a direct call cannot loop through its own wrapper.Validation against Quattro
14abc0762: account lifecycle suite (43 checks, including concurrency, exact process lifetime, SIGPIPE and rollback), real mise 2026.10.3 dispatch (40, including a user-installed Claude and a real Claude ahead of mise's wrapper), recovery (7), autoswitch (16), copy (6), default agent (50), and CLI all pass. Independent adversarial review reproduced and then verified the fix for an orphaned CLI whose environment no longer reveals its pending home; regressions also cover direct registration, incomplete logins, retained receipts and recovery after session exit. At 9868831 on Quattro60cb9bf3, autoswitch (17) and recovery (8) each gain a case: an expired active account over the threshold is still switched away from, and registration waits up to a second for a finished login's guardian to release its claim. The mise dispatch suite was not re-run at this head.