openai / openai/codex

Allow periods in --profile names for versioned model profiles

Open
#43,310 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI config enhancement
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Problem

Codex rejects periods in profile-v2 names before looking up the corresponding config file. This prevents natural versioned profile names such as glm-5.3, even though the lookup contract is $CODEX_HOME/<name>.config.toml and glm-5.3.config.toml is an ordinary safe filename.

Reproduction

With $CODEX_HOME/glm-5.3.config.toml present:

$ codex --profile glm-5.3 exec --json --skip-git-repo-check --ephemeral 'Reply OK'
error: invalid value 'glm-5.3' for '--profile <CONFIG_PROFILE_V2>': invalid --profile value `glm-5.3`; pass a plain name such as `work`

Observed with codex-cli 0.153.4.

Cause

ProfileV2Name::from_str in protocol/src/config_types.rs accepts only ASCII alphanumerics, _, and -:

.all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'-'))

The parsed value is then used by resolve_profile_v2_config_path to select <name>.config.toml. A period is not a path separator and does not by itself enable traversal.

Expected behavior

--profile glm-5.3 should load $CODEX_HOME/glm-5.3.config.toml.

Acceptance criteria

  • Permit . inside a profile name.
  • Continue rejecting empty names, /, \, absolute paths, .. path components, and other traversal forms.
  • Add parser and config-resolution tests for glm-5.3.
  • Keep existing alphanumeric, hyphen, and underscore profile names compatible.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in protocol/src/config_types.rs at ProfileV2Name::from_str, then follow resolve_profile_v2_config_path to understand config lookup and existing validation. Add parser and config-resolution coverage for glm-5.3 while preserving rejection of empty, absolute, separator, and traversal forms. Done means the profile loads $CODEX_HOME/glm-5.3.config.toml and existing valid names remain compatible.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.