Repository navigation
Description
Area
Authentication and account pool
What are you trying to accomplish?
Land the work of the closed pull request #7344 in six small pull requests against dev, as @lidge-jun asked in #7344 (comment). The design question stays in #7345.
What prevents this today?
#7344 was one large change that conflicted with dev, and its retention policy is still open in #7345. Most of the change does not depend on that policy, but it was in the same pull request.
What should OpenCodex do?
Take the work in this order. Each step is one pull request on the latest dev.
| PR | Content | Behavior change | Depends on |
|---|---|---|---|
| 1a | One reader. Every caller that reads <CODEX_HOME>/auth.json itself (main-account.ts, auth-collision.ts, auth-api/account-pause-group.ts, account-lifecycle.ts, orca-import.ts, desktop-compatibility/native-identity.ts) calls one module. The module still reads the file on each call. Includes a guard test that fails when a new src/ line names auth.json outside an allowlist. |
None | — |
| 1b | One writer. The refresh and reauth writes in main-account.ts and the switch, rollback and recovery writes in native-profile-manager.ts go through one module. |
None | 1a |
| 2a | Watcher. A separate module that watches auth.json and reports its new state: complete, empty, partial, missing or unreadable. |
None until a caller uses it | 1a |
| 2b | In-memory copy. Keeps the last complete login and takes its input from the 2a watcher. | Yes: the retention policy of #7345 | 2a, #7345 |
| 2c | Checked write. Before the rename, the writer checks the file again. A change by Codex wins over the OpenCodex write. | Yes: an OpenCodex write can be dropped | 1b |
| 2d | Grace setting nativeMainAuthGraceSeconds. |
Yes: the grace time becomes configurable | 2b |
Example usage or interface
1a and 1b add no setting and no command. 2d adds nativeMainAuthGraceSeconds (whole seconds). Its default follows the decision in #7345.
Alternatives or workarounds
Keep #7344 closed and drop the work.
Additional context
I will open 1a and 1b first, because they do not change behavior. 2b and 2d wait for #7345. Tell me if you want a different order or a different cut.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
MarcTCruz commentedon Oct 24, 2026
I opened this by mistake. #7345 is still open, so the plan is now there: #7345 (comment)