model_catalog_json in profile not honoured

Open 💬 4 comments Opened Aug 20, 2026 by siddhpant

What version of Codex CLI is running?

v0.148.0

What subscription do you have?

Enterprise

Which model were you using?

_No response_

What platform is your computer?

Linux

What terminal emulator and version are you using (if applicable)?

_No response_

Codex doctor report

What issue are you seeing?

I set model_catalog_json in a profile file.

Codex doesn't apply that setting.

The setting isn't present on main config.

What steps can reproduce the bug?

Make a model_catalog_json and use it in a profile.

What is the expected behavior?

The setting is honoured.

Additional information

_No response_

View original on GitHub ↗

4 Comments

tsuvic · 7 days ago

Source trace on main (@67b2c8c): model_catalog_json inside a legacy [profiles.X] table is dead config — it parses but is never applied.

  • The field is applied only from the merged effective config: load_model_catalog(cfg.model_catalog_json…) (codex-rs/core/src/config/mod.rs:3878), where cfg is the layer-stack merge result.
  • The legacy [profiles.X] tables parse into ConfigToml.profiles (codex-rs/config/src/config_toml.rs:312–317; the field exists in the legacy ConfigProfile at codex-rs/config/src/profile_toml.rs:41), but nothing merges those tables into the effective config. The legacy selector is now a hard error: "legacy profile = … config is no longer supported; use --profile {profile} with {profile}.config.toml instead" (mod.rs:3222–3229).

The working path today is profile v2: put model_catalog_json in ${CODEX_HOME}/NAME.config.toml and run with --profile NAME. That file is merged as a full ConfigToml layer above the user config (codex-rs/config/src/loader/mod.rs:105–119, 310–357), so the field is honored there. (If you combine --profile NAME with a same-named legacy table, the loader errors with migration guidance — loader/mod.rs:330–343.)

So the setting isn't broken — it's silently ignored in the legacy table shape. The trap is that [profiles.X] still parses without warning; a load-time warning (or rejection) for unapplied legacy profile tables would make this discoverable.

siddhpant · 7 days ago

@tsuvic I added it in profile file as mentioned in the issue description. The profile file implies profilev2. The setting is not honoured in new way.

Your AI model assumed an incorrect case.

tsuvic · 7 days ago

@siddhpant
I thought I had reproduced a similar issue and was hoping the information might be helpful, but sorry I’ll check it later.

claell · 5 days ago

Interested in this one: profile-scoped catalogs would let provider-specific model metadata stay out of the base config, which is the cleaner layout for managing several custom providers side by side.

We will verify locally how model_catalog_json behaves in a profile file on current versions and report back with details if it reproduces here.