Skip to content

cli: rename profile v2 flag to --profile#23883

Merged
jif-oai merged 3 commits into
mainfrom
jif/profile-v2-to-profile
May 21, 2026
Merged

cli: rename profile v2 flag to --profile#23883
jif-oai merged 3 commits into
mainfrom
jif/profile-v2-to-profile

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 21, 2026

Why

Profile v2 is taking over the user-facing profile selection path, so the CLI no longer needs to expose the transitional --profile-v2 spelling. This switches the public args surface to --profile before the remaining legacy profile plumbing is removed separately.

What

  • Rebind --profile and -p to the v2 profile name argument that selects $CODEX_HOME/<name>.config.toml.
  • Stop parsing the legacy shared CLI profile argument while keeping its implementation path in place for follow-up cleanup.
  • Update CLI validation, profile-name parse errors, and the legacy-profile collision message/tests to refer to --profile.

Testing

  • cargo test -p codex-cli -p codex-config -p codex-protocol -p codex-utils-cli

@jif-oai jif-oai changed the title chore: ship profile v2 cli: rename profile v2 flag to --profile May 21, 2026
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

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dd593f839

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

Comment thread codex-rs/utils/cli/src/shared_options.rs
Comment thread codex-rs/utils/cli/src/shared_options.rs
Copy link
Copy Markdown

@usgenes39-dotcom usgenes39-dotcom left a comment

Choose a reason for hiding this comment

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

I would block this before merging.

Findings:

  1. codex-rs/utils/cli/src/shared_options.rs:38 repurposes the public --profile/-p flag to config_profile_v2, but existing legacy callers still use codex exec --profile <name> with [profiles.<name>]. One concrete in-tree example is codex-rs/core/tests/suite/cli_stream.rs::exec_cli_profile_applies_model_instructions_file: it writes [profiles.default] and invokes codex exec --profile default. With this PR, that invocation becomes a v2 profile selection, codex-rs/config/src/loader/mod.rs detects the matching legacy [profiles.default], and the command fails before making the request. The current PR testing omitted codex-core; Bazel is already failing on Linux gnu/musl for this head, which is consistent with this path. Please migrate these callers/fixtures in the same PR or preserve legacy --profile behavior until they are migrated.

  2. The PR also removes the --profile-v2 spelling entirely. Users and scripts that already adopted the transitional flag now fail clap parsing even though a hidden alias would keep compatibility while still documenting only the new --profile spelling.

  3. Making v2 profile selection the public --profile path exposes an existing unsafe default: if $CODEX_HOME/<name>.config.toml is missing, load_config_toml_for_required_layer treats NotFound as an empty table and the session continues with base config. After this rename, a typo such as codex exec --profile cheap can silently run with the default model/provider/service tier instead of the intended profile. Since profiles can route model choice, provider, approval policy, and service tier, this is a product/economic correctness issue rather than just CLI polish. Please require the selected v2 profile file to exist, or at least fail/warn for runtime selection, before making this spelling the primary user-facing --profile.

Checked: PR patch, config layer loading, exec/TUI option propagation, legacy profile collision logic, and current CI status for 4dd593f839fdec645d5c69edecd257d66ef2c973.

@jif-oai jif-oai requested a review from a team as a code owner May 21, 2026 14:31
@jif-oai jif-oai merged commit 8a511d5 into main May 21, 2026
29 checks passed
@jif-oai jif-oai deleted the jif/profile-v2-to-profile branch May 21, 2026 14:45
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants