cli: rename profile v2 flag to --profile#23883
Conversation
There was a problem hiding this comment.
💡 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".
usgenes39-dotcom
left a comment
There was a problem hiding this comment.
I would block this before merging.
Findings:
-
codex-rs/utils/cli/src/shared_options.rs:38repurposes the public--profile/-pflag toconfig_profile_v2, but existing legacy callers still usecodex exec --profile <name>with[profiles.<name>]. One concrete in-tree example iscodex-rs/core/tests/suite/cli_stream.rs::exec_cli_profile_applies_model_instructions_file: it writes[profiles.default]and invokescodex exec --profile default. With this PR, that invocation becomes a v2 profile selection,codex-rs/config/src/loader/mod.rsdetects the matching legacy[profiles.default], and the command fails before making the request. The current PR testing omittedcodex-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--profilebehavior until they are migrated. -
The PR also removes the
--profile-v2spelling 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--profilespelling. -
Making v2 profile selection the public
--profilepath exposes an existing unsafe default: if$CODEX_HOME/<name>.config.tomlis missing,load_config_toml_for_required_layertreatsNotFoundas an empty table and the session continues with base config. After this rename, a typo such ascodex exec --profile cheapcan 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.
Why
Profile v2 is taking over the user-facing profile selection path, so the CLI no longer needs to expose the transitional
--profile-v2spelling. This switches the public args surface to--profilebefore the remaining legacy profile plumbing is removed separately.What
--profileand-pto the v2 profile name argument that selects$CODEX_HOME/<name>.config.toml.--profile.Testing
cargo test -p codex-cli -p codex-config -p codex-protocol -p codex-utils-cli