Client or integration
Codex CLI
Area
CLI
Summary
ocx sync and ocx restore back fail permanently on my install with a message that names no reason:
Codex sync did not complete. Fix the reported Codex config issue and retry.
Plain `codex` was not switched back to opencodex. Fix the reported Codex config issue and retry.
No "Codex config issue" is ever printed — not on stdout, not on stderr, and ocx doctor reports every check ok. There is nothing to act on, so the instruction "fix the reported issue and retry" cannot be followed.
This has two compounding consequences, because of the ordering documented in src/cli/index.ts:
// Only warn/restart when a catalog or models_cache write actually happened. This is
// deliberately not an `else`: refreshCodexModelCatalog runs before injectCodexConfig,
// so a sync can fail (`ok: false`) after the catalog was already rewritten
- The model catalog is rewritten before the injection fails, so it is left truncated. My proxy serves 435 models (200 native, 157 openrouter/opencode-go, 43 Anthropic, 35 Google) but
opencodex-catalog.json contains only 9, all OpenAI-family. The non-OpenAI models are reachable through the proxy but never appear in Codex.
- Routing is never restored.
ocx stop and ocx update both remove the injected openai_base_url and model_catalog_json root keys. Since sync / restore back can never complete, nothing puts them back. After every update I have to re-add them by hand from <CODEX_HOME>/opencodex.config.toml.
Expected: either the sync succeeds, or the specific config problem is printed so it can be fixed. Ideally the catalog would also not be rewritten until the injection is known to succeed.
Reproduction
100% reproducible on my install, across ocx update, full restarts of the proxy, and two different versions (2.11.0 and 2.12.0).
- Have opencodex injected into Codex (
openai_base_url + model_catalog_json present in <CODEX_HOME>/config.toml).
- Run
ocx stop (or ocx update, which stops as its first step). The two injected root keys are removed.
- Start the proxy again and confirm it is healthy (
/healthz → 200, /v1/models → full list).
- Run
ocx restore back → fails with the message above.
- Run
ocx sync → fails with the message above.
- Inspect
opencodex-catalog.json → rewritten, but containing only the OpenAI-family models.
The proxy is healthy throughout. The only way I have found to restore routing is editing config.toml manually using the keys documented in <CODEX_HOME>/opencodex.config.toml.
Things I ruled out
To save triage time, I checked the obvious candidates and none of them apply:
- Config is valid UTF-8 — strict
TextDecoder('utf-8', {fatal: true}) decode succeeds.
- No duplicate TOML tables — 185
[projects.*] entries, zero duplicate keys.
- Size is modest — 33,524 bytes.
- Proxy is healthy —
/healthz 200, /v1/models returns 435 entries, live requests succeed.
ocx doctor is entirely clean — every check ok, including "Codex restart safety", "Project Codex configs", and "OAuth reliability".
- Not the stripped keys themselves — the failure persists identically after routing is manually restored and verified working end-to-end.
Not a duplicate of the nearby catalog issues
Suggested fixes
- Print the actual reason.
syncModelsToCodex returns ok: false but the caller only prints a generic sentence referring to a "reported" issue that is never reported. Surfacing the underlying error would make this self-service.
- Do not rewrite the catalog before the injection is known to succeed, or roll the catalog back when injection fails — otherwise a failed sync actively degrades a working install by truncating the model list.
- Consider having
ocx doctor exercise the same code path, since it currently reports a fully healthy system while sync cannot complete.
Version
2.12.0 (also reproduced on 2.11.0)
Operating system
Windows 11 Pro 10.0.26200
Provider and model
Proxy serves 435 models across openai (native), openrouter, opencode-go and anthropic; the Codex-facing catalog is reduced to 9 OpenAI-family entries.
Logs or error output
$ ocx sync
Codex sync did not complete. Fix the reported Codex config issue and retry.
$ ocx restore back
Plain `codex` was not switched back to opencodex. Fix the reported Codex config issue and retry.
$ ocx sync-cache
WARNING: 4 Codex app-server process(es) still running (PIDs: ...). Disk catalog/cache were
updated, but Codex may keep showing the old model list until those processes restart.
# catalog still contains 9 models afterwards
$ ocx doctor
# every section reports ok, including:
# Codex restart safety ok
# Project Codex configs ok no project-local provider bypass detected
# OAuth reliability [OK] x3
# proxy is healthy and multi-provider the whole time:
GET /healthz -> 200
GET /v1/models -> 435 models
{"openai-native":200,"opencode-go/openrouter-other":157,"anthropic":43,"google":35}
# but the Codex-facing catalog:
<CODEX_HOME>/opencodex-catalog.json -> {"models": [ ...9 entries, all OpenAI-family... ]}
Screenshots and supporting files
No response
Redacted configuration
{
"providers": {
"openai": { "adapter": "openai-responses", "codexAccountMode": "direct", "authMode": "forward" },
"openrouter": { "adapter": "openai-chat", "baseUrl": "https://openrouter.ai/api/v1" },
"opencode-go": { "adapter": "openai-chat", "baseUrl": "https://opencode.ai/zen/go/v1" },
"anthropic": { "adapter": "anthropic", "authMode": "oauth" }
},
"defaultProvider": "openrouter",
"activeCodexAccountId": "__main__"
}
<CODEX_HOME>/config.toml is 33 KB with 185 [projects.*] trust entries, valid UTF-8, no duplicate keys.
Checks
Client or integration
Codex CLI
Area
CLI
Summary
ocx syncandocx restore backfail permanently on my install with a message that names no reason:No "Codex config issue" is ever printed — not on stdout, not on stderr, and
ocx doctorreports every checkok. There is nothing to act on, so the instruction "fix the reported issue and retry" cannot be followed.This has two compounding consequences, because of the ordering documented in
src/cli/index.ts:opencodex-catalog.jsoncontains only 9, all OpenAI-family. The non-OpenAI models are reachable through the proxy but never appear in Codex.ocx stopandocx updateboth remove the injectedopenai_base_urlandmodel_catalog_jsonroot keys. Sincesync/restore backcan never complete, nothing puts them back. After every update I have to re-add them by hand from<CODEX_HOME>/opencodex.config.toml.Expected: either the sync succeeds, or the specific config problem is printed so it can be fixed. Ideally the catalog would also not be rewritten until the injection is known to succeed.
Reproduction
100% reproducible on my install, across
ocx update, full restarts of the proxy, and two different versions (2.11.0 and 2.12.0).openai_base_url+model_catalog_jsonpresent in<CODEX_HOME>/config.toml).ocx stop(orocx update, which stops as its first step). The two injected root keys are removed./healthz→ 200,/v1/models→ full list).ocx restore back→ fails with the message above.ocx sync→ fails with the message above.opencodex-catalog.json→ rewritten, but containing only the OpenAI-family models.The proxy is healthy throughout. The only way I have found to restore routing is editing
config.tomlmanually using the keys documented in<CODEX_HOME>/opencodex.config.toml.Things I ruled out
To save triage time, I checked the obvious candidates and none of them apply:
TextDecoder('utf-8', {fatal: true})decode succeeds.[projects.*]entries, zero duplicate keys./healthz200,/v1/modelsreturns 435 entries, live requests succeed.ocx doctoris entirely clean — every checkok, including "Codex restart safety", "Project Codex configs", and "OAuth reliability".Not a duplicate of the nearby catalog issues
ocx sync-cachereports the disk catalog was updated and the count stays at 9, so this is not the stale-app-server case.ocx startinjectingopenai_base_urlunwantedly. Here the injection fails and never happens.Suggested fixes
syncModelsToCodexreturnsok: falsebut the caller only prints a generic sentence referring to a "reported" issue that is never reported. Surfacing the underlying error would make this self-service.ocx doctorexercise the same code path, since it currently reports a fully healthy system whilesynccannot complete.Version
2.12.0 (also reproduced on 2.11.0)
Operating system
Windows 11 Pro 10.0.26200
Provider and model
Proxy serves 435 models across openai (native), openrouter, opencode-go and anthropic; the Codex-facing catalog is reduced to 9 OpenAI-family entries.
Logs or error output
Screenshots and supporting files
No response
Redacted configuration
{ "providers": { "openai": { "adapter": "openai-responses", "codexAccountMode": "direct", "authMode": "forward" }, "openrouter": { "adapter": "openai-chat", "baseUrl": "https://openrouter.ai/api/v1" }, "opencode-go": { "adapter": "openai-chat", "baseUrl": "https://opencode.ai/zen/go/v1" }, "anthropic": { "adapter": "anthropic", "authMode": "oauth" } }, "defaultProvider": "openrouter", "activeCodexAccountId": "__main__" }<CODEX_HOME>/config.tomlis 33 KB with 185[projects.*]trust entries, valid UTF-8, no duplicate keys.Checks