Skip to content

fix(codex): count per-account homes in usage and state removal blast radius - #9763

Merged
brennanb2025 merged 2 commits into
mainfrom
fix-codex-account-removal-data-loss
Jul 21, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
fix-codex-account-removal-data-loss

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

Two fixes from the codex-home architecture audit ahead of the v1.4.149 stable debut:

  • Usage scanner blind spot (audit F2): getCodexSessionDirectories() only scanned the shared runtime mirror and the real ~/.codex, so all sessions written to per-account self-contained homes (codex-accounts/<id>/home/sessions) were silently missing from usage. Now enumerated from disk via a new codex-account-home-discovery module (disk-based so rollouts retained after account changes still count, and CLI callers need no settings store; existing inode-alias dedup covers hardlinked duplicates).
  • Account-removal dialog copy (audit F1 mitigation): under the self-contained-home architecture, removing an account rmSyncs the only on-disk copy of that account's session history and MCP credentials. The confirm dialog copy predated this and described deleting disposable auth state. It now states the real, irreversible blast radius. (Removal-impact counts + live-session guard tracked as a follow-up — needs a new cross-runtime RPC surface.)

Validation

  • pnpm run typecheck
  • node config/scripts/verify-localization-catalog.mjs (full key parity, all locales)
  • pnpm run check:max-lines-ratchet
  • scanner suites 22/22 incl. new per-account coverage test
  • changed-file oxlint clean

…radius

- usage scanner now includes codex-accounts/*/home/sessions so multi-account
  usage is no longer silently undercounted (audit F2)
- account-removal dialog copy now states that session history and MCP logins
  are permanently deleted with the managed home (audit F1 mitigation)
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@brennanb2025, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 19bfc3ac-db3c-41ec-a1a4-14008612b2b6

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd7f56 and 15ae086.

📒 Files selected for processing (7)
  • src/main/codex-usage/scanner-large-directory.test.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex/codex-account-home-discovery.ts
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
📝 Walkthrough

Walkthrough

Per-account Codex homes are now scanned for existing home/sessions directories alongside managed runtime and system Codex locations. Directory discovery handles missing account roots and deduplicates results, with tests covering accounts with and without session trees. Codex account removal confirmation text now describes permanent deletion of session history and MCP logins, undo limitations, and fallback behavior for active accounts across supported locales.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and validation, but it omits required template sections for screenshots, testing checklist, AI review, security audit, and notes. Add the missing template sections, including Screenshots, a full Testing checklist, AI Review Report, Security Audit, and Notes, or mark them not applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main changes: per-account usage scanning and account-removal blast-radius messaging.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 7ca3e67 into main Jul 21, 2026
1 check passed
brennanb2025 added a commit that referenced this pull request Jul 21, 2026
…radius (#9763)

* fix(codex): count per-account homes in usage and state removal blast radius

- usage scanner now includes codex-accounts/*/home/sessions so multi-account
  usage is no longer silently undercounted (audit F2)
- account-removal dialog copy now states that session history and MCP logins
  are permanently deleted with the managed home (audit F1 mitigation)

* fix(codex): harden account usage discovery
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…radius (stablyai#9763)

* fix(codex): count per-account homes in usage and state removal blast radius

- usage scanner now includes codex-accounts/*/home/sessions so multi-account
  usage is no longer silently undercounted (audit F2)
- account-removal dialog copy now states that session history and MCP logins
  are permanently deleted with the managed home (audit F1 mitigation)

* fix(codex): harden account usage discovery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant