You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a diagnostic log line for each write to the managed Codex account registry, so a saved account that disappears can be traced to an add or re-auth, a removal, or another registry write.
Each line carries only a fixed operation name, the row count before the write, the row count requested, the row count written, and success or failure.
A successful deletion of a managed account home directory logs the operation name only.
No account IDs, emails, paths, tokens or error text are logged. The field construction lives in a pure helper (rust/src/codex_accounts/registry_log.rs) with unit tests that fail if a path, identifier, email or token fragment appears in the output.
Operation mapping: add and re-auth log add-or-reauth, account removal logs remove, and every other registry write logs registry-write.
Upstream references:
Sources/CodexBarCore/ManagedCodexAccountStore.swift (hunks at old lines 27, 73 and 87): the Mutation enum, the registry-write log fields operation, rows.before, rows.requested, rows.written, and logHomeDeletion.
Sources/CodexBar/ManagedCodexAccountService.swift (hunks at old lines 296 and 326): add and remove paths set the mutation.
Files changed:
rust/src/codex_accounts/registry_log.rs (new): operation enum, pure field builder, logging helpers, unit tests.
rust/src/codex_accounts/stores.rs: AccountStore::save delegates to a new save_with_operation, which counts existing rows, writes, and logs.
rust/src/codex_accounts/account_manager.rs: logs a home deletion after a failed add is torn down and after a removal deletes a managed home.
rust/src/codex_accounts/mod.rs: module wiring and re-export of RegistryOperation.
apps/desktop-tauri/src-tauri/src/commands/codex_accounts.rs: add and re-auth pass AddOrReauth, remove passes Remove, other saves pass RegistryWrite.
cargo test --manifest-path rust/Cargo.toml --lib codex_accounts: 74 passed, 0 failed. Includes the 4 new registry_log tests.
cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml codex_accounts: 19 passed, 0 failed.
cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml (full): 804 passed, 0 failed, plus the 19 above in the same crate.
cargo test --manifest-path rust/Cargo.toml --lib (full): 5265 passed, 18 failed on the first run. All 18 were providers::grok::acp::process_tests, which need examples/fake_grok_acp built. cargo test --lib does not build examples, so the first run was missing the binary. After cargo build --manifest-path rust/Cargo.toml --example fake_grok_acp, cargo test --lib grok::acp passes 41 of 41.
Not covered:
No desktop app launch or UI proof. This change has no UI surface; it only adds log lines.
The log lines were not inspected in a running app. The tests check the field values, not the tracing output.
Summary by CodeRabbit
Improvements
Account addition, reauthentication, removal, and loading continue to use the existing account-management flows. Registry updates now record operation status and account counts, with sensitive details omitted from those records.
User-Facing Changes
No changes to account-management behavior or interface are noted in this update.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Account registry writes now carry operation labels and log row counts and outcomes. Account command flows assign labels for add or reauthentication, removal, and routine writes. Successful managed-home deletions also emit operation-tagged logs.
Changes: Account Registry Logging
Layer / File(s)
Summary
Registry log records and operation labels rust/src/codex_accounts/registry_log.rs, rust/src/codex_accounts/mod.rs
The registry module defines fixed operation names and logs write counts and outcomes, plus successful managed-home deletions. Tests check the permitted values and count formats.
Account store write logging rust/src/codex_accounts/stores.rs
save delegates to save_with_operation with RegistryWrite. The new method captures available prior counts, writes the account file, logs the result, and returns the write result.
Operation tags in account flows apps/desktop-tauri/src-tauri/src/commands/codex_accounts.rs, rust/src/codex_accounts/account_manager.rs
Add and reauthentication writes use AddOrReauth; removal writes use Remove; fetch and default persistence use RegistryWrite. Successful managed-home deletions log their operation. Authentication errors remain unchanged after best-effort cleanup.
No actionable issue is established for this change. Normal validation, including checking log output in a running app, remains appropriate.
Pre-merge checks: 8
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title is a short imperative summary that accurately describes the main change: adding redacted logs for Codex registry mutations.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed
The changed code adds only redacted Codex registry diagnostics and operation tagging. registry_log.rs emits fixed operation names, numeric row counts, and fixed result values; home-deletion logs emi…
Secrets Handled Safely
The new tracing events emit only fixed operation names, numeric row counts, and static success or failure values. They do not format account data, paths, errors, tokens, cookies, API keys, or authoriz…
No Unapproved Dependencies
The pull-request diff changes only five Rust source files. It does not change any Cargo.toml, package.json, npm/yarn lockfile, or pnpm packageManager setting. No dependency addition requires maintaine…
Ui Changes Include Windows Proof
PASS: The diff changes only Codex account persistence and redacted tracing diagnostics. It does not change files under apps/desktop-tauri/src, tray rendering, the float bar, settings, or window chro…
Full details: Provider Data Stays Siloed
Explanation
The changed code adds only redacted Codex registry diagnostics and operation tagging. registry_log.rs emits fixed operation names, numeric row counts, and fixed result values; home-deletion logs emit only the operation. stores.rs passes only account counts to the logger, and no identity, plan, label, email, path, token, or provider-specific data is added to logs or storage. The diff adds no cross-provider branching or matching on ProviderId in shared code.
Full details: Secrets Handled Safely
Explanation
The new tracing events emit only fixed operation names, numeric row counts, and static success or failure values. They do not format account data, paths, errors, tokens, cookies, API keys, or authorization headers. Account persistence still uses secure_file, and the new save_with_operation does not alter credential-file writes. Home deletion behavior was pre-existing and remains restricted to app-owned managed homes; the PR only adds a fixed-operation log after an explicit removal or failed add cleanup.
Full details: No Unapproved Dependencies
Explanation
The pull-request diff changes only five Rust source files. It does not change any Cargo.toml, package.json, npm/yarn lockfile, or pnpm packageManager setting. No dependency addition requires maintainer approval.
Full details: Ui Changes Include Windows Proof
Explanation
PASS: The diff changes only Codex account persistence and redacted tracing diagnostics. It does not change files under apps/desktop-tauri/src, tray rendering, the float bar, settings, or window chrome. The PR description also states that the change has no UI surface.
✨ Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rust/src/codex_accounts/registry_log.rs) with unit tests that fail if a path, identifier, email or token fragment appears in the output.add-or-reauth, account removal logsremove, and every other registry write logsregistry-write.Upstream references:
Sources/CodexBarCore/ManagedCodexAccountStore.swift(hunks at old lines 27, 73 and 87): theMutationenum, the registry-write log fieldsoperation,rows.before,rows.requested,rows.written, andlogHomeDeletion.Sources/CodexBar/ManagedCodexAccountService.swift(hunks at old lines 296 and 326): add and remove paths set the mutation.Files changed:
rust/src/codex_accounts/registry_log.rs(new): operation enum, pure field builder, logging helpers, unit tests.rust/src/codex_accounts/stores.rs:AccountStore::savedelegates to a newsave_with_operation, which counts existing rows, writes, and logs.rust/src/codex_accounts/account_manager.rs: logs a home deletion after a failed add is torn down and after a removal deletes a managed home.rust/src/codex_accounts/mod.rs: module wiring and re-export ofRegistryOperation.apps/desktop-tauri/src-tauri/src/commands/codex_accounts.rs: add and re-auth passAddOrReauth, remove passesRemove, other saves passRegistryWrite.Checks
cargo fmt --all: clean.cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: passes.cargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings: passes.cargo test --manifest-path rust/Cargo.toml --lib codex_accounts: 74 passed, 0 failed. Includes the 4 newregistry_logtests.cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml codex_accounts: 19 passed, 0 failed.cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml(full): 804 passed, 0 failed, plus the 19 above in the same crate.cargo test --manifest-path rust/Cargo.toml --lib(full): 5265 passed, 18 failed on the first run. All 18 wereproviders::grok::acp::process_tests, which needexamples/fake_grok_acpbuilt.cargo test --libdoes not build examples, so the first run was missing the binary. Aftercargo build --manifest-path rust/Cargo.toml --example fake_grok_acp,cargo test --lib grok::acppasses 41 of 41.Not covered:
Summary by CodeRabbit