Connecting Ollama in Codex App writes top-level model_provider + model_catalog_json, hiding OpenAI models and causing 404s for gpt-5.5
What version of Codex is running?
codex-cli 0.142.5 / Codex App 26.623.81905 (macOS)
What issue are you seeing?
Connecting the Codex desktop app to Ollama persists top-level keys into ~/.codex/config.toml:
model_provider = "ollama-launch-codex-app"
model_catalog_json = "/Users/ummi/.codex/ollama-launch-models.json"
These globally hijack every subsequent Codex session (CLI and app), not just the Ollama one:
- OpenAI models disappear from the model picker. When
model_catalog_jsonis set,load_model_catalog(codex-rs/core/src/config/mod.rs) replaces the catalog, and the TUI picker (codex-rs/tui/src/chatwidget/model_popups.rs,try_list_models()) lists only catalog entries — so only Ollama models are selectable and gpt-5.5/gpt-5.4 etc. vanish. - 404s against localhost.
model = "gpt-5.5"is still set while the default provider is now Ollama, so requests go tohttp://127.0.0.1:11434/v1/responsesand fail with404 model 'gpt-5.5' not found. This appears to be the root cause behind #30647 / #29703 / #29848, and is related to the picker filtering in #19694.
Notably the app also writes a correct scoped [profiles.ollama-launch] with model_provider = "ollama-launch" — the top-level writes are redundant with it and are what causes the breakage.
What steps can reproduce the bug?
- Have a working OpenAI-authenticated Codex setup.
- In the Codex app, connect to Ollama (launch/connect local models flow).
- Inspect
~/.codex/config.toml: top-levelmodel_providerandmodel_catalog_jsonnow point at Ollama. - Start a new Codex session: the model picker no longer shows OpenAI models; selecting/keeping gpt-5.5 yields
404 Not Found: model 'gpt-5.5' not foundfrom127.0.0.1:11434.
What is the expected behavior?
Connecting a local provider should be additive, not a global takeover:
- The Ollama flow should scope its settings to the profile it already creates (
[profiles.ollama-launch]) instead of writing top-levelmodel_provider/model_catalog_json. - Alternatively (or additionally), when
model_catalog_jsonis set, the picker should merge the custom catalog with the built-in OpenAI presets (or scope the catalog to its provider) rather than replacing them, so users can switch back without hand-editing config.toml. - If the default provider is switched,
modelshould be remapped to a model that exists on that provider rather than left pointing at gpt-5.5.
Workaround
Delete the two top-level lines (model_provider = "ollama-launch-codex-app", model_catalog_json = ...) from ~/.codex/config.toml; the Ollama profile keeps working via codex --profile ollama-launch.
Additional information
Happy to submit a PR for the merge-instead-of-replace behavior in the catalog/picker path if maintainers agree with the direction.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I can reproduce the same user-impact on a newer macOS build:
deepseek-v4-flash:0731-cloudAfter using the documented Codex App / Ollama flow, the app became an Ollama-only experience: OpenAI account models were no longer available in the picker, the normal composer model display disappeared, and returning to the OpenAI setup required manual configuration recovery. This is especially risky because the user-level config is shared by the ChatGPT-integrated app and local Codex.
Could Codex App support a first-class, per-thread provider selection model that:
The current global-provider behavior makes the documented custom-provider capability unsuitable for users who need to alternate between their ChatGPT subscription and Ollama Cloud/local models.
User feedback: this behavior is extremely surprising and should not happen automatically.
I installed/downloaded Codex because I want to use Codex/OpenAI models. Connecting Ollama should be an additive, explicitly scoped option — it should not silently replace the global
model_provider/model_catalog_jsonand make OpenAI models disappear from the picker.From a UX perspective this feels destructive: the user enables a local provider, then Codex itself appears "broken" until they discover they must manually edit
~/.codex/config.toml. Most users will not understand that Ollama modified a global Codex setting behind the scenes.Expected behavior should be one of:
A local-provider integration should be opt-in and reversible from the UI, not a silent global takeover.
This matches why guided setups that rewrite top-level model_provider and model_catalog_json feel risky, and why additive flows matter.
We are building a small local provider manager that adds [model_providers.*] entries additively with backup and dry-run preview instead of overwriting the top-level selection or replacing the whole catalog. The hiding of built-in OpenAI models described here is exactly the failure mode that approach tries to avoid.
Cross-referencing #29156 (Desktop custom-provider usability) and #36532 (additive/API-key-scoped catalog mechanism).