Repository navigation
Description
Client or integration
Codex App
Area
Proxy and routing
Summary
When codexDesktopAuthless: true (or another provider-table routing form) injects model_provider = "opencodex" alongside a retained root openai_base_url override (applyPaginatedOpenaiCompat / HISTORY_RELABEL_STANDS_DOWN), Codex Desktop 26.1029.61003 (codex-cli 0.166.0-alpha.6) refuses thread/resume and thread/list for every existing paginated conversation whose threads.model_provider (and rollout session_meta.payload.model_provider) is still tagged "openai":
This chat uses openai, but your current provider is opencodex. Switch to openai to continue.
In codex-cli 0.154.0-alpha.6.2 / 0.159.2 (Codex Desktop 26.1027.51404), retaining the root openai_base_url override while leaving paginated openai-tagged threads untouched (src/codex/inject/paginated-openai-compat.ts) worked because thread/resume did not enforce thread.model_provider == config.model_provider. Starting in codex-cli 0.166.0-alpha.6, codex.exe enforces a strict provider-id equality check before resuming or listing a thread, stranding all pre-authless paginated openai-tagged conversations (323 active user threads on this home) whenever model_provider = "opencodex" is active, or conversely stranding all opencodex-tagged conversations if the user switches back to Design B (model_provider unset / "openai").
Reproduction
- Have existing Codex Desktop conversations created under Design B loopback routing (or native OpenAI routing) that Codex has migrated to
history_mode = "paginated"in~/.codex/state_5.sqlitewiththreads.model_provider = "openai"and rollout line 1session_meta.payload.model_provider = "openai". - Enable
"codexDesktopAuthless": truein~/.opencodex/config.jsonand runocx start(or let the background service inject). - Observe
~/.opencodex/service.log:AndInjected opencodex as default provider into Codex config (authless Desktop mode: requires_openai_auth = false). Codex resume history: left unchanged; existing threads keep reaching the proxy through the retained openai_base_url override.~/.codex/config.tomlnow contains both:model_provider = "opencodex" openai_base_url = "http://127.0.0.1:10100/backend-api/codex" [model_providers.opencodex] name = "OpenCodex Proxy" base_url = "http://127.0.0.1:10100/v1" wire_api = "responses" requires_openai_auth = false
- Update or launch Codex Desktop
26.1029.61003(bundledcodex.exeversioncodex-cli 0.166.0-alpha.6). - Attempt to open/resume any pre-existing
openai-tagged thread in Codex Desktop (or click Retry on the banner). - Observe the red error banner in Codex Desktop:
继续聊天未成功 — This chat uses openai, but your current provider is opencodex. Switch to openai to continue.
And observe thatmcp__codex_app__list_threads/thread/listonly returns the 24 threads wherethreads.model_provider = 'opencodex', hiding the 323 non-archived user threads wherethreads.model_provider = 'openai'.
Version
2.96.0 (commit 684ad75d254ae96a9971387d09ae428b96ada9c2; verified unchanged in v2.97.0 and dev at src/codex/inject/plan.ts and src/codex/inject/paginated-openai-compat.ts)
Operating system
Windows 11 Pro 25H2 (Build 26200.9711)
Provider and model
Not provider-specific (reproduced on thread using google-antigravity/gemini-4-argon, sub2-claude/claude-sonnet-5-5, Gemini4/gemini-3.8-flash-high)
Logs or error output
# 1. Exact banner in Codex Desktop 26.1029.61003:
继续聊天未成功
This chat uses openai, but your current provider is opencodex. Switch to openai to continue.
# 2. Binary string check across codex-cli versions on the same machine:
codex-cli 0.130.0-alpha.5 -> 0 hits for "but your current provider is"
codex-cli 0.159.2 -> 0 hits for "but your current provider is"
codex-cli 0.166.0-alpha.6 -> 1 hit ("This chat uses ..., but your current provider is .... Switch to ... to continue.")
# 3. ~/.codex/state_5.sqlite row for the affected thread:
{
"id": "01a0aa2c-5898-77c1-966d-ceb9468c815d",
"source": "vscode",
"thread_source": "user",
"model_provider": "openai",
"model": "google-antigravity/gemini-4-argon",
"history_mode": "paginated",
"cli_version": "0.154.0-alpha.6.2"
}
# 4. ~/.codex/logs_2.sqlite showing 26.1027.51404 succeeding at 06:03:59Z, then 26.1029.61003 rejecting thread/resume before session_init at 10:08:56Z-10:09:08Z:
2026-11-04T06:03:59Z WARN codex_core::shell_snapshot app_server.request{rpc.method="thread/resume" app_server.client_version="26.1027.51404"}:thread_spawn:session_init ... thread_id=01a0aa2c-5898-77c1-966d-ceb9468c815d
2026-11-04T10:08:56Z TRACE codex_app_server::message_processor app-server request: thread/resume connection_id=ConnectionId(0) request_id=String("thread/resume:8c5a3ca0-eee6-4890-8aac-f57a832709d6")
(immediately rejected prior to thread_spawn / session_init)
Screenshots and supporting files
Why applyPaginatedOpenaiCompat in src/codex/inject/paginated-openai-compat.ts no longer suffices on codex-cli >= 0.166.0-alpha.6:
paginated-openai-compat.tsassumes that keepingopenai_base_url = "http://127.0.0.1:10100/backend-api/codex"alongsidemodel_provider = "opencodex"lets paginatedopenai-tagged rows resume through Codex's built-inopenaiprovider entry without relabeling.- While Codex still merges
openai_base_urlonto the built-inopenaientry,codex-cli 0.166.0-alpha.6now gatesthread/resumeandthread/liston the active rootmodel_providermatching the thread's recordedmodel_provider. - As a result, a home that has both pre-authless paginated
openaithreads and post-authlessopencodexthreads cannot access both sets under a singlemodel_provider, andpaginated-openai-compat.tsstands down from relabeling paginated threads (HISTORY_RELABEL_STANDS_DOWN).
Redacted configuration
{
"port": 10100,
"codexDesktopAuthless": true
}# ~/.codex/config.toml (injected headers)
model = "sub2-claude/claude-opus-5-5"
model_reasoning_effort = "xhigh"
model_catalog_json = "C:\\Users\\<user>\\.codex\\opencodex-catalog.json"
model_provider = "opencodex"
# Auto-injected by opencodex (undo: ocx restore)
openai_base_url = "http://127.0.0.1:10100/backend-api/codex"
[model_providers.opencodex]
name = "OpenCodex Proxy"
base_url = "http://127.0.0.1:10100/v1"
wire_api = "responses"
requires_openai_auth = falseChecks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
github-actions commentedon Nov 5, 2026
Automated translation bookkeeping — detected language: English.
Ingwannu commentedon Nov 7, 2026
Thanks for the detailed report. The client-side change checks out:
codex-cli 0.166.0contains the newModelProviderMismatchresume error ("This chat uses {provider}, but your current provider is {current}. Switch to {provider} to continue.",openai/codexcodex-rs/app-server-protocol/src/protocol/v2/model_provider_error.rs), and the string is absent from 0.164.That breaks the premise of
src/codex/inject/paginated-openai-compat.ts:12-16ondev(aaa3c20f3f): it keeps the rootopenai_base_urloverride next tomodel_provider = "opencodex"and relies on paginatedopenai-tagged threads resuming through Codex's built-inopenaientry, while the relabel stands down (HISTORY_RELABEL_STANDS_DOWN,src/codex/history-provider.ts:337). With Codex now requiring the thread's provider to equal the activemodel_provider, a home with both paginatedopenaithreads andopencodexthreads cannot reach both sets under one provider-table configuration.The way forward (native-writer-coordinated relabel, a different routing form for mixed homes, or documenting the trade-off) is a design decision for the owner; leaving this open for that. No further information needed from you at this point.
lidge-jun commentedon Nov 10, 2026
Still reproduces on
dev:src/codex/inject/paginated-openai-compat.tskeeps the rootopenai_base_urloverride and relies on paginatedopenai-tagged threads resuming through Codex's built-inopenaientry, and codex-cli ≥ 0.166 now refuses that withModelProviderMismatch. A home with both paginatedopenaithreads andopencodexthreads cannot reach both under one provider-table configuration.Owner decision on the direction:
openairows exist, refuse the authless transition with a message that states the trade-off (those threads cannot be resumed underopencodex). No data is touched. This stops the silent stranding.threads.model_providerand the rolloutsession_metaprovider for paginated rows only while Codex is verifiably stopped (the same quiescence the history code already requires). Every thread resumes, but this needs careful design and review because it writes Codex-owned state.Recommendation: 1 now, so no new home strands its threads, and 2 as a designed follow-up.
lidge-jun commentedon Nov 10, 2026
Decision (coordinator, 11-11): when the resolved Codex is 0.166 or later and paginated
openai-tagged threads exist, refuse the authless transition and say why. Thread labels are not rewritten; that would be a separately reviewed follow-up. Implementation follows in a PR for this issue.fix(codex): refuse the provider-table switch on Codex 0.166+ with pag…