Skip to content

[upstream #10394] feat(codex-accounts): import existing CODEX_HOME without re-login - #58

Open
innocarpe wants to merge 10000 commits into
mainfrom
feat/import-existing-codex-home
Open

innocarpe wants to merge 10000 commits into
mainfrom
feat/import-existing-codex-home

Conversation

@innocarpe

@innocarpe innocarpe commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds Import CODEX_HOME next to Add Account in Settings → Codex Accounts
  • Copies an already-authenticated external CODEX_HOME into Orca managed storage and registers it as a normal managed account without running codex login again (issue Option B)
  • Validates auth.json, resolves OAuth identity (email required), refuses import from Orca managed storage or WSL slots (host only for now)

Closes stablyai#10366

Motivation

Power users keep isolated homes (~/.codex-work, device-auth flows, enterprise login). Today every extra account must go through Orca's browser login, so those homes cannot be reused.

Implementation

  • CodexAccountService.importAccountFromExistingHome(sourceHomePath, target?)
  • Shared helpers in import-existing-codex-home.ts (validate, copy, ownership marker)
  • IPC codexAccounts:importExistingHome + preload API
  • UI: folder picker → import; disabled for remote / WSL scope
  • Applies the OAuth provider policy to the imported config when no canonical config exists

Test plan

  • Unit: import helpers (auth.json required, reject managed storage, copy + marker)
  • Unit: service imports without spawn/codex login, rejects API-key-only and WSL target
  • Full service.test.ts + helper tests (72 pass, including custom-provider import rejection)
  • Manual: Settings → Codex Accounts → Import CODEX_HOME → pick ~/.codex-* with prior codex login → account appears and becomes active without browser login

Notes

  • Host runtime only; WSL import can follow if needed
  • Source directory is left intact (copy, not move)

ELI5

You can import an already-logged-in CODEX_HOME into Orca managed accounts without running codex login again. Handy if you keep separate Codex homes for different workflows.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support importing an existing CODEX_HOME