Skip to content

Preserve Codex runtime config preferences - #3944

Merged
Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/codex-config
May 31, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/codex-config

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve Codex runtime preferences such as /model and /fast by keeping one shared Orca Codex environment for config, hooks, sessions, skills, plugins, prompts, themes, and history.
  • Add selected host launch homes under codex-runtime-home/launch/host/<selection>/home so fresh host terminals get isolated auth.json per selected Codex account/system default while non-auth state stays shared.
  • Harden token read-back and cleanup: refreshed tokens are read from the selected launch home, stale shared auth cannot switch another account, system-default launch-home refreshes are mirrored back, and removed accounts delete marked launch-home credentials.
  • Add design doc: docs/codex-account-auth-isolated-launch-homes.md.

Test Plan

  • pnpm exec vitest run --config config/vitest.config.ts src/main/codex-accounts/runtime-home-service.test.ts src/main/codex-accounts/service.test.ts src/main/codex/codex-home-paths.test.ts src/main/rate-limits/service.test.ts src/renderer/src/lib/codex-session-restart.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty.test.ts -t "Codex home"
  • pnpm run lint
  • pnpm run tc:node
  • pnpm run tc:cli
  • pnpm run tc:web
  • Electron dev validation with isolated ORCA_USER_DATA_PATH: app rendered at http://localhost:5174/, system launch home was materialized with marker/auth/shared state, screenshot captured at tmp/electron-codex-launch-home-final/orca-visible.png.

Notes / Residual Risk

  • Old already-open host shells keep their original CODEX_HOME/ORCA_CODEX_HOME; fresh PTYs are fixed, but idle shells still need restart/stale-session UX if we want account switches to affect already-spawned processes.
  • WSL remains on the existing per-distro runtime-home model; same-distro WSL multi-account stale-auth races are out of scope for this host-focused change.
  • On locked-down Windows where file symlinks are unavailable, hooks.json is not copied into launch homes because a copy can break Codex hook trust path semantics. This is safer than silently pretending hooks are trusted, but hook visibility needs a follow-up design if required.
  • Unknown Codex-created top-level launch-home files, such as live sqlite files, are not adopted into shared state until we classify them. Known shared entries are synchronized/reconciled.

Risk: high

Risk assessment: High. This touches Codex runtime-home selection, account auth read-back, system-default auth mirroring, and PTY launch behavior. It has focused unit/integration coverage plus Electron smoke validation, but old live shell behavior and Windows hook-link fallback remain explicit residual risks.

@nwparker nwparker added the risk:high High risk change label May 30, 2026
@Jinwoo-H
Jinwoo-H merged commit ec01ffb into main May 31, 2026
1 check passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/codex-config branch May 31, 2026 21:22
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high High risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants