Conversation
Lampese
left a comment
There was a problem hiding this comment.
Requesting changes for one behavioral issue:
The live-auth reconciliation path is doing more than syncing the active account. When the current ~/.codex/auth.json does not match an existing stored account, the backend creates a brand new stored account and persists it immediately. The frontend then triggers this path on startup, on window focus, and every 5 seconds. In practice, that means switching Codex externally can silently import new persistent accounts into Codex Switcher without the user explicitly adding them.
That feels materially broader than the PR's stated goal of reconciling the stored active account with the real live auth state. I think this should be resolved before merging, either by limiting reconciliation to active-state alignment or by making auto-import an explicit user-approved action.
Summary
This PR reconciles the stored active account with the real Codex
auth.jsonstate so the UI does not stay stuck on a stale account after an external switch.What changed
~/.codex/auth.jsonauth.jsonWhy
The stored
active_account_idcan drift from the actual Codex auth file when the user switches accounts outside the switcher. In that state, the UI shows the wrong active account and can operate on stale credentials.Validation
pnpm buildcargo build --manifest-path src-tauri/Cargo.tomlsync_live_auth_to_store()against the current machine state and confirmed the stored active account already matched the live~/.codex/auth.jsonaccount (osborne03961)