Skip to content

client side modelinfo overrides - #12101

Merged
sayan-oai merged 7 commits into
mainfrom
dev/sayan/modelinfo-overrides-2
Feb 19, 2026
Merged

sayan-oai merged 7 commits into
mainfrom
dev/sayan/modelinfo-overrides-2

Conversation

@sayan-oai

@sayan-oai sayan-oai commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR
Add top-level model_catalog_json config support so users can supply a local model catalog override from a JSON file path (including adding new models) without backend changes.

Problem

Codex previously had no clean client-side way to replace/overlay model catalog data for local testing of model metadata and new model entries.

Fix

  • Add top-level model_catalog_json config field (JSON file path).
  • Apply catalog entries when resolving ModelInfo:
    1. Base resolved model metadata (remote/fallback)
    2. Catalog overlay from model_catalog_json
    3. Existing global top-level overrides (model_context_window, model_supports_reasoning_summaries, etc.)

Note

Will revisit per-field overrides in a follow-up

Tests

Added tests

Comment thread codex-rs/core/src/config/mod.rs Outdated
Comment on lines +1276 to +1279
/// Accepts:
/// - a path to a JSON file containing `ModelsResponse`,
/// - a JSON string containing a serialized `ModelsResponse`, or
/// - a TOML inline `ModelsResponse` object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we could drop support for JSON string and get rid of the custom deserialize, but that would make it harder for codex web to supply a full ModelInfo object if files cant be put into containers.

Comment thread codex-rs/protocol/src/openai_models.rs Outdated
Comment on lines +217 to +221
///
/// `#[derive(ModelPatch)]` auto-generates `ModelInfoPatch`, which is used by `model_info.overrides`
/// in config to apply per-field updates. All fields are patchable unless marked `#[model_patch(skip)]`.
/// Patch updates are set-only.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, TS, JsonSchema, ModelPatch)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

use a macro to generate the partial ModelInfoPatch type from ModelInfo. a bit complex, but avoids statically defining a mirrored type in code and having ugly apply logic like was drafted here.

to avoid either approach, we could support passing overrides only via a catalog_json file path or a predetermined struct with a subset of ModelInfo fields that could be overridden. this would force codex web to put a file with the updated models catalog into the container though.

@sayan-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

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: 25fcef0850

ℹ️ 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 on lines +80 to +82
// todo(sayan): Make preset/list/default-model flows config-aware so
// `model_info.catalog_json` and `model_info.overrides` are reflected in
// picker/app-server model metadata as well (today only get_model_info uses them).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can do this as part of this pr or in a follow up, but it doesnt block the eval/codex web use cases because only UX currently misses the overrides.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we do the loading inside load_remote_models_from_file? we decide which file to load from inside it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this would make the model catalog a replacement for the existing models.json rather than an overlay, but i think thats fair.

@sayan-oai
sayan-oai force-pushed the dev/sayan/modelinfo-overrides-2 branch from 13a84bd to e4e9625 Compare February 19, 2026 07:53
@sayan-oai
sayan-oai enabled auto-merge (squash) February 19, 2026 18:28
@sayan-oai
sayan-oai disabled auto-merge February 19, 2026 18:38
@sayan-oai
sayan-oai merged commit d54999d into main Feb 19, 2026
28 of 33 checks passed
@sayan-oai
sayan-oai deleted the dev/sayan/modelinfo-overrides-2 branch February 19, 2026 18:39
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 19, 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