Repository navigation
Conversation
Commit account selection, credit guards and cleanup metadata through the existing durable writer. Delete only after acknowledgement, retain failed cleanup for startup/manual retry, and keep ownership proof through partial deletion. Co-authored-by: kazu-42 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (28)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughAccount removal now persists removal-recovery metadata with account and reset-credit ledger updates before attempting managed-home cleanup. Failed cleanup leaves a pending record that startup or a later removal attempt can retry. Managed-home validation and removal now report cleanup results and handle verified missing homes. The account settings pane displays pending removals and disables selection and reauthentication for those accounts. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Codex account removal can retain and retry failed cleanup, and pending accounts remain accessible for retry. No identified issue currently prevents merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change improves removal safety by saving recovery information before deleting credentials and keeping failed cleanup retryable. Pending accounts are blocked from selection and reauthentication. Remaining uncertainty concerns behavior on unavailable WSL shares and compatibility with older remote clients, rather than a demonstrated expansion of deletion privileges. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 22 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This replaces #11655 and fixes the reported case where a managed Codex account disappeared from the roster while its credential files stayed on disk with no way to retry cleanup. The whole branch (1 commit, 28 files) was reviewed.
- Removal is now committed before deletion —
CodexAccountSelection.removecommits the roster/selection change pluscodexAccountRemovalRecoveryand the pruned reset-credit ledger through the newPrimaryStateWriteOperations.updateCodexAccountStateAndFlush, so a failed commit preserves the account and a lost acknowledgement leaves a recovery record for restart. - Cleanup failure is a first-class pending state —
safeRemovereturnsboolean; on success a second commit clears the recovery record, on failure the record survives and is retried by the constructor's startup loop and by Remove. - Ownership-safe emptying —
assert/ownership gain anallowEmptyHomeoption (host, mounted WSL, and the generated WSL shell check) so an interrupted cleanup that left an empty, marker-less home can finish, while the marker is retained until credential-bearing entries are gone; WSL absence is confirmed through a readable ancestor. - Renderer —
AccountsPanesurfaces pending removals in the roster; the row disables selection and re-auth while keeping Remove enabled to retry. - Tests/translations — new durability, cleanup-recovery, WSL-script, and row tests; new
codexRemovalPending/codexRemovalRetrystrings in all seven locales.
Verification I ran: the 26 new/updated tests and 27 modified codex suites pass; pnpm tc:node, pnpm tc:web, and pnpm run check:code-quality:changed origin/main all pass. I traced the durability rollback/listener ordering against the existing updateSettings/async-writer contract and the deletion/ownership paths (including partial deletion, marker-gone-but-credentials-remain, empty-home recovery, WSL absent vs. unreadable, and find failure under set -euo pipefail) and found no path that deletes a non-owned home, reports a credential-bearing home as removed, or wedges an empty home.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
kazu-42
left a comment
There was a problem hiding this comment.
Reviewed 5b722344671659d26148024395284e4b0f100eba independently against the changes requested on #11655. I agree with using this as the replacement.
The smaller flow preserves the relevant safety boundaries: account removal, selection and reset-credit cleanup commit together before credential deletion; a known commit failure rolls back the account fields while preserving unrelated later preferences; an unknown outcome leaves credentials for recovery; post-commit cleanup failures keep a separate pending record. Pending records stay outside the selectable roster, and ownership evidence survives partial deletion. The host/default lifecycle and WSL paths retain their existing behavior.
Local verification on this exact head, with disposable fixture homes and ORCA_BACKGROUND_LAUNCH=1:
- Account/runtime/Settings-row tests: 58 files, 428 passed.
- Persistence tests: 103 files, 1,022 passed, 4 skipped. Removing the one overlapping file gives 160 files and 1,445 passed tests overall.
- Node, Web and CLI typechecks passed.
- Changed-code quality: zero new findings across 22 code files; whitespace check passed.
- Current-head hosted checks read back as 27 success and 13 skipped, with no unresolved review threads.
The local skips are native Windows process identity, Linux PID namespace, and two opt-in Bun/Node cross-runtime scenarios. I did not repeat the rendered Electron check or perform a live Windows/WSL/paired-SSH mutation. The two stream dependencies missing from the older local dependency tree were installed at the branch's exact versions in an isolated test overlay; shared dependencies and source files were not changed.
No remaining blocking findings in this review. I will close #11655 as superseded and keep #24944 as a separate Draft dependent on this durability change; its old Store-preview integration must not be applied to this implementation.

ELI5
Removing a Codex account can hide its row even though its login files remain. Save the removal before deleting files, and keep failed cleanup visible for retry.
What Changed
Why
This is a reproduced failure case, without a confirmed customer incident or frequency estimate. The account queue and durable writer already provide serialization, acknowledgement and known-failure rollback. Reusing them keeps runtime synchronization after the commit and makes cleanup failure an explicit pending state.
Replacement for #11655. Production code is +330/-98, net 232 lines, versus net 461 there. The entire PR is 28 files, +1128/-119; tests account for +785/-20 and translations for +13/-1. It uses one removal commit and one cleanup completion commit, without adding Store preview mode or a runtime repair loop.
Linked Issue
Fixes #11653
Visual Proof
Same refused ownership check, using isolated profiles and hidden Electron renderers on macOS.
Before on main: the account row disappears, but its credential file remains.
After: the pending row keeps Remove available and disables selection and re-authentication. Verified that it survives app restart.
After repairing the test fixture's ownership marker and choosing Remove again, both the managed home and pending row disappear.
Testing
785 tests across 105 suites passed: account service, runtime routing, the persistence writer and Accounts UI. Coverage includes delayed acknowledgement, failed commit, committed write with lost acknowledgement, restart retry, failed completion write, partial deletion, refused ownership, WSL absence/unavailability and disabled pending actions.
pnpm tc,pnpm run check:code-quality:changed origin/main, formatting andgit diff --checkpassed. The Electron dev build and actual UI removal/restart/retry flow passed.Executed locally on macOS, including the generated WSL ownership script against Bash. Native Windows/WSL, Linux and remote-host integration depend on CI; no real account credentials were used.
Review
Self-reviewed the commit/deletion ordering, failure outcomes, host lifecycle, cross-version account roster and deletion boundaries. Retains ownership recovery work from #11655, with contributor attribution in the commit.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Cleanup executes on the account's owning runtime. Optional reply fields preserve mixed-version compatibility. Existing filesystem retries stay bounded; startup uses the existing queue without recurring polling. Ownership failures remain visible and require the underlying problem to be resolved before retry can succeed.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Changed-file quality and focused tests passed locally; CI covers full lint/test and packaged builds.