Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e9fe149
feat(auth): add backup restore manager
ndycode Mar 12, 2026
c10e66b
test(auth): cover backup restore manager flow
ndycode Mar 12, 2026
bd8060b
fix(auth): harden named backup restore paths
ndycode Mar 13, 2026
7443074
Merge branch 'git-plan/01-reset-safety' into git-plan/02-backup-resto…
ndycode Mar 13, 2026
f5f3945
fix(storage): cover restore backup edge cases
ndycode Mar 13, 2026
c659e72
fix(auth): harden backup restore follow-up
ndycode Mar 13, 2026
11f8c45
fix(storage): guard backup restore edge cases
ndycode Mar 13, 2026
bf93df9
fix(auth): close backup restore review gaps
ndycode Mar 13, 2026
d12e6da
fix(auth): refresh restore eligibility before confirm
ndycode Mar 13, 2026
a0544ff
fix(storage): honor null restore snapshots
ndycode Mar 14, 2026
17d943e
fix(auth): bound restore assessment concurrency
ndycode Mar 14, 2026
d832af8
fix(storage): surface backup scan failures
ndycode Mar 14, 2026
a21b017
test(auth): harden restore concurrency regression
ndycode Mar 14, 2026
f5a3e00
fix(auth): harden backup restore discovery
ndycode Mar 14, 2026
65ee48c
fix(auth): harden backup restore edge cases
ndycode Mar 14, 2026
a12a748
fix(storage): reject invalid named backup entries
ndycode Mar 14, 2026
ee7a402
fix(auth): close restore review follow-ups
ndycode Mar 14, 2026
c6ce2b7
fix(auth): close remaining restore review gaps
ndycode Mar 14, 2026
348ac7f
fix(auth): tighten restore eligibility edges
ndycode Mar 14, 2026
5d85159
fix(storage): reuse assessed backup paths
ndycode Mar 14, 2026
1208639
fix(auth): align restore confirm flow
ndycode Mar 14, 2026
7f6870d
fix(auth): harden restore path guards
ndycode Mar 14, 2026
9ebc86e
fix(auth): tighten backup restore edge cases
ndycode Mar 14, 2026
da40e70
fix(storage): preserve duplicate-only metadata updates
ndycode Mar 14, 2026
b107ba8
fix(storage): align restore assessment with import semantics
ndycode Mar 14, 2026
72b4367
fix: close remaining backup restore review gaps
ndycode Mar 14, 2026
a80c1e3
fix: reuse listed backups during restore assessment
ndycode Mar 14, 2026
edd1dc6
test: harden win32 stat retry coverage
ndycode Mar 14, 2026
28ab430
test: guard win32 platform spy cleanup
ndycode Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/reference/storage-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Override root:
| --- | --- |
| Unified settings | `~/.codex/multi-auth/settings.json` |
| Accounts | `~/.codex/multi-auth/openai-codex-accounts.json` |
| Named backups | `~/.codex/multi-auth/backups/<name>.json` |
| Accounts backup | `~/.codex/multi-auth/openai-codex-accounts.json.bak` |
| Accounts WAL | `~/.codex/multi-auth/openai-codex-accounts.json.wal` |
| Flagged accounts | `~/.codex/multi-auth/openai-codex-flagged-accounts.json` |
Expand Down Expand Up @@ -56,6 +57,7 @@ Backup metadata:
When project-scoped behavior is enabled:

- `~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json`
- `~/.codex/multi-auth/projects/<project-key>/backups/<name>.json`

`<project-key>` is derived as:

Expand Down Expand Up @@ -100,6 +102,13 @@ Rules:
- `.rotate.`, `.tmp`, and `.wal` names are rejected
- existing files are not overwritten unless a lower-level force path is used explicitly

Restore workflow:

1. Run `codex auth login`.
2. Open the `Recovery` section.
3. Choose `Restore From Backup`.
4. Pick a backup and confirm the merge summary before import.

---

## oc-chatgpt Target Paths
Expand All @@ -115,6 +124,7 @@ Experimental sync targets the companion `oc-chatgpt-multi-auth` storage layout:
## Verification Commands

```bash
codex auth login
codex auth status
codex auth list
```
Expand Down
11 changes: 11 additions & 0 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export type LoginMode =
| "check"
| "deep-check"
| "verify-flagged"
| "restore-backup"
| "cancel";

export interface ExistingAccountInfo {
Expand Down Expand Up @@ -233,6 +234,14 @@ async function promptLoginModeFallback(
) {
return { mode: "verify-flagged" };
}
if (
normalized === "u" ||
normalized === "backup" ||
normalized === "restore" ||
normalized === "restore-backup"
) {
return { mode: "restore-backup" };
}
if (normalized === "q" || normalized === "quit")
return { mode: "cancel" };
console.log(UI_COPY.fallback.invalidModePrompt);
Expand Down Expand Up @@ -287,6 +296,8 @@ export async function promptLoginMode(
return { mode: "deep-check" };
case "verify-flagged":
return { mode: "verify-flagged" };
case "restore-backup":
return { mode: "restore-backup" };
case "select-account": {
const accountAction = await showAccountDetails(action.account);
if (accountAction === "delete") {
Expand Down
Loading