Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

profile-level model_catalog_json overrie (#12410)

sayan-oai5a635f342710
diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json
index 23963196a1..addbcbe313 100644
--- a/codex-rs/core/config.schema.json
+++ b/codex-rs/core/config.schema.json
@@ -440,6 +440,14 @@
"model": {
"type": "string"
},
+ "model_catalog_json": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/AbsolutePathBuf"
+ }
+ ],
+ "description": "Optional path to a JSON model catalog (applied on startup only)."
+ },
"model_instructions_file": {
"allOf": [
{
diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rs
index ca3978b73d..ddc5aa9cdd 100644
--- a/codex-rs/core/src/config/mod.rs
+++ b/codex-rs/core/src/config/mod.rs
@@ -1908,7 +1908,12 @@ impl Config {
let review_model = override_review_model.or(cfg.review_model);
let check_for_update_on_startup = cfg.check_for_update_on_startup.unwrap_or(true);
- let model_catalog = load_model_catalog(cfg.model_catalog_json.clone())?;
+ let model_catalog = load_model_catalog(
+ config_profile
+ .model_catalog_json
+ .clone()
+ .or(cfg.model_catalog_json.clone()),
+ )?;
let log_dir = cfg
.log_dir
diff --git a/codex-rs/core/src/config/profile.rs b/codex-rs/core/src/config/profile.rs
index 3c7d575cdc..61b02adcd0 100644
--- a/codex-rs/core/src/config/profile.rs
+++ b/codex-rs/core/src/config/profile.rs
@@ -27,6 +27,8 @@ pub struct ConfigProfile {
pub plan_mode_reasoning_effort: Option<ReasoningEffort>,
pub model_reasoning_summary: Option<ReasoningSummary>,
pub model_verbosity: Option<Verbosity>,
+ /// Optional path to a JSON model catalog (applied on startup only).
+ pub model_catalog_json: Option<AbsolutePathBuf>,
pub personality: Option<Personality>,
pub chatgpt_base_url: Option<String>,
/// Optional path to a file containing model instructions.