Skip to content

feat: add layered profile-v2 config files#17141

Open
jif-oai wants to merge 17 commits intomainfrom
jif/profile-v2
Open

feat: add layered profile-v2 config files#17141
jif-oai wants to merge 17 commits intomainfrom
jif/profile-v2

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Apr 8, 2026

Why

--profile-v2 lets runtime entry points run with a named user profile file while still inheriting the normal base user config. This supports launchers and workflows that need profile-specific defaults, MCP/plugin settings, or config write targets without duplicating the whole config.toml into a separate file.

The selected profile is intentionally a layer, not a replacement: --profile-v2 work loads $CODEX_HOME/config.toml first and then $CODEX_HOME/work.config.toml on top.

What Changed

  • Added the shared --profile-v2 <name> CLI option and plain-name validation for $CODEX_HOME/<name>.config.toml.
  • Threaded the selected profile config through the TUI, exec, review, resume, fork, and debug prompt-input runtime paths.
  • Extended config loading so the base user config remains in the layer stack and the selected profile becomes the active writable user layer.
  • Updated user-config writes from the TUI, config service, and MCP tool approval persistence to write to the selected profile config when one is active.
  • Made plugin, marketplace, and MCP reads use the merged user config so base and profile layers both participate.
  • Updated config hot reload to refresh both the base user config and selected profile layer.

Limits

--profile-v2 is still rejected for config-management subcommands such as feature, MCP, or marketplace edits. Those commands stay tied to the base config.toml for now.

A few background or adjacent write paths are still not fully profile-aware and may continue to update base config.toml or global state:

  • configured marketplace auto-upgrade metadata
  • automatic MCP dependency installs from skills
  • remote plugin sync or uninstall config edits
  • personality migration marker/default writes

Verification

  • Added targeted unit coverage for resolve_profile_v2_config_path, user-layer merging, selected profile writes, config service writes, session hot reload, plugin config merging, and MCP tool approval persistence.

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Apr 8, 2026

@codex review

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

💡 Codex Review

Config::load_default_with_cli_overrides(cli_kv_overrides.clone()).map_err(|e| {

P1 Badge Preserve profile-v2 path in fallback config load

When ConfigBuilder fails, app-server falls back via Config::load_default_with_cli_overrides(...), which drops loader_overrides.user_config_path. Later ConfigEditsBuilder::for_config(&config) resolves to $CODEX_HOME/config.toml, so sessions started with --profile-v2 can persist edits (e.g. skills/tool approvals) into the wrong file after an invalid selected config.

ℹ️ 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".

@jif-oai jif-oai requested a review from a team as a code owner April 21, 2026 12:25
@jif-oai jif-oai changed the title feat: profile v2 feat: add layered profile-v2 config files Apr 21, 2026
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