client side modelinfo overrides (#12101)

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
This commit is contained in:
sayan-oai
2026-02-19 10:38:57 -08:00
committed by GitHub
parent 3a951f8096
commit d54999d006
13 changed files with 178 additions and 30 deletions

View File

@@ -582,6 +582,7 @@ async fn prefers_apikey_when_config_prefers_apikey_even_with_chatgpt_tokens() {
codex_home.path().to_path_buf(),
auth_manager,
SessionSource::Exec,
config.model_catalog.clone(),
);
let NewThread { thread: codex, .. } = thread_manager
.start_thread(config)

View File

@@ -12,7 +12,7 @@ async fn offline_model_info_without_tool_output_override() {
let auth_manager = codex_core::test_support::auth_manager_from_auth(
CodexAuth::create_dummy_chatgpt_auth_for_testing(),
);
let manager = ModelsManager::new(config.codex_home.clone(), auth_manager);
let manager = ModelsManager::new(config.codex_home.clone(), auth_manager, None);
let model_info = manager.get_model_info("gpt-5.1", &config).await;
@@ -30,7 +30,7 @@ async fn offline_model_info_with_tool_output_override() {
let auth_manager = codex_core::test_support::auth_manager_from_auth(
CodexAuth::create_dummy_chatgpt_auth_for_testing(),
);
let manager = ModelsManager::new(config.codex_home.clone(), auth_manager);
let manager = ModelsManager::new(config.codex_home.clone(), auth_manager, None);
let model_info = manager.get_model_info("gpt-5.1-codex", &config).await;