Skip to content

Add persistent application-level Codex Home selection - #618

Open
Joseffb wants to merge 1 commit into
Dimillian:mainfrom
Joseffb:feat/configurable-codex-home
Open

Joseffb wants to merge 1 commit into
Dimillian:mainfrom
Joseffb:feat/configurable-codex-home

Conversation

@Joseffb

@Joseffb Joseffb commented Oct 18, 2026

Copy link
Copy Markdown

Summary

Adds a persistent Codex Home setting independently of the Codex executable, so users can select the configuration and session environment CodexMonitor connects to.

My use case: I run the normal OpenAI Codex desktop app alongside a Codex CLI configured for DeepSeek. CodexMonitor connects to that DeepSeek CLI. I need CodexMonitor to use its separate home for configuration, global instructions, models, and sessions while the normal desktop app continues using its own environment.

Behavior

  • Adds Browse, Validate, Save, and Use default controls under Settings → Codex, with the effective canonical home displayed.
  • Resolves the home from the saved application setting, then inherited CODEX_HOME, then ~/.codex. Symlinked home directories work; an unavailable explicit home errors without silently selecting another environment.
  • Uses the selected home consistently for child app-servers, global editors, prompts, agents, local usage, and workspace/session operations. Switching homes stops existing runtimes and reloads the UI; active turns stop.
  • Verifies the app-server home when the initialization response reports it. Older app-servers may omit that field, so their executable must honor the supplied CODEX_HOME.
  • Retains the existing global AGENTS.md external-symlink exception from Allow global AGENTS.md symlinks outside CODEX_HOME #297. Config and workspace file containment remain strict, and dangling links fail explicitly.
  • Keeps the local Home control disabled in remote mode; remote editors use the connected daemon's own persisted home.

This is an application-wide home selector, not a credential manager or a per-workspace account switcher. It does not copy credentials, provision provider access, or change the system launch environment. Related to #66, but does not implement that issue's full scope. Existing Queue/Steer defaults are preserved.

Validation

On macOS arm64, against contribution commit 811686c:

  • npm run typecheck — passed.
  • npm run test — 141 files / 1,015 tests passed.
  • npm run lint — no errors; five warnings in unchanged files.
  • npm run build — passed, with the existing large-chunk warning.
  • cargo check --locked — passed.
  • cargo test --locked — 458 tests passed across library and binary targets (239 + 189 + 29 + 1).
  • Targeted compatibility tests were observed failing before restoring Queue defaults and the upstream global AGENTS symlink exception, then passed.
  • Contribution secret scan and diff whitespace checks passed.

Native macOS checks on the separately installed candidate exercised selecting/editing the home, model and reasoning discovery, an actual provider-backed GUI request, quit/relaunch and session restoration, simultaneous operation with OpenAI Codex, and an unavailable-home error without fallback. That installed candidate shares the home feature but has local packaging and preference differences; it is not a native build of this exact PR commit. The contribution's compatibility corrections are covered by the tests above. Windows and Linux native behavior have not been exercised locally.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T03:19:58.182305Z 811686c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 811686c4bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

...appSettings,
codexBin: nextCodexBin,
codexArgs: nextCodexArgs,
codexHome: nextCodexHome,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Serialize settings writes before reloading the new home

When a stale full AppSettings save overlaps this one—for example, the fire-and-forget default-model normalization in SettingsCodexSection (lines 168-176) can start while home validation/save is in flight—it carries the previous codexHome. There is no frontend save queue or version check, so if that invocation reaches update_app_settings_core after this one, the backend treats the stale value as a second home switch and persists the old environment; the reload on line 224 can then reconnect to the wrong provider/home. Serialize full-settings writes or make this update patch/version based so an older snapshot cannot undo the selected home.

Useful? React with 👍 / 👎.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant