Skip to content

feat(core): support custom model aliases in config.toml#13665

Closed
friel-openai wants to merge 8 commits intomainfrom
dev/codex/add-custom-models-support-in-config.toml
Closed

feat(core): support custom model aliases in config.toml#13665
friel-openai wants to merge 8 commits intomainfrom
dev/codex/add-custom-models-support-in-config.toml

Conversation

@friel-openai
Copy link
Contributor

@friel-openai friel-openai commented Mar 6, 2026

Superseded by #13825.

This older PR is kept only as historical reference. The current, canonical custom-model PR is #13825, which carries the rebased branch head and the cleaned-up PR description.

Copy link
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: b8e4d9af73

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

This adds config.toml-defined model aliases that map to provider model slugs while applying alias-specific context settings for the active session.

- added custom_models config entries plus schema and docs coverage
- taught ModelsManager to resolve aliases to a provider-facing request_model while preserving the user-facing alias slug
- applied alias-specific context_window and model_auto_compact_token_limit overrides during model info resolution
- updated session/test plumbing and added regression coverage for alias resolution with local and remote model catalogs

Model selection and per-session context overrides already flow through ModelsManager and Config. Resolving aliases there keeps the provider slug separate from the user-facing alias while reusing the existing override plumbing.

- just write-config-schema
- just fmt
- cargo test -p codex-app-server -p codex-api -p codex-exec -p codex-mcp-server
- cargo test -p codex-tui
- cargo test -p codex-protocol -p codex-core (same two existing seatbelt failures remained in this environment: create_seatbelt_args_with_read_only_git_pointer_file and create_seatbelt_args_with_read_only_git_and_codex_subpaths)
- just fix -p codex-core -p codex-protocol -p codex-app-server -p codex-api -p codex-exec -p codex-mcp-server -p codex-tui
Accept custom model aliases from [[custom_models]] entries so user config matches the documented TOML shape.

Also add explicit alias names plus duplicate-alias validation and refresh the generated schema/docs to match.
List custom model aliases before bundled models in the picker while keeping default-model selection anchored to the bundled priority order when bundled presets exist.

Also add a regression test covering the new ordering.
Use the existing model_info::with_config_overrides path for alias-specific context window and auto-compact overrides instead of mutating those fields inline in ModelsManager.

The custom alias path now folds alias-level override values into a temporary config and reuses the centralized override helper, which keeps the precedence behavior unchanged while removing duplicated override logic.
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