Skip to content

[Bug]: Codex Desktop 26.1029 (codex-cli 0.166.0-alpha.6) refuses to resume paginated openai-tagged threads when codexDesktopAuthless sets model_provider = opencodex #8191

Closed

Description

@LeoWang331

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

  1. 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.sqlite with threads.model_provider = "openai" and rollout line 1 session_meta.payload.model_provider = "openai".
  2. Enable "codexDesktopAuthless": true in ~/.opencodex/config.json and run ocx start (or let the background service inject).
  3. Observe ~/.opencodex/service.log:
    Injected 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.
    
    And ~/.codex/config.toml now 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
  4. Update or launch Codex Desktop 26.1029.61003 (bundled codex.exe version codex-cli 0.166.0-alpha.6).
  5. Attempt to open/resume any pre-existing openai-tagged thread in Codex Desktop (or click Retry on the banner).
  6. 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 that mcp__codex_app__list_threads / thread/list only returns the 24 threads where threads.model_provider = 'opencodex', hiding the 323 non-archived user threads where threads.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.ts assumes that keeping openai_base_url = "http://127.0.0.1:10100/backend-api/codex" alongside model_provider = "opencodex" lets paginated openai-tagged rows resume through Codex's built-in openai provider entry without relabeling.
  • While Codex still merges openai_base_url onto the built-in openai entry, codex-cli 0.166.0-alpha.6 now gates thread/resume and thread/list on the active root model_provider matching the thread's recorded model_provider.
  • As a result, a home that has both pre-authless paginated openai threads and post-authless opencodex threads cannot access both sets under a single model_provider, and paginated-openai-compat.ts stands 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 = false

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. added
    bug
    proxy
    on Nov 5, 2026
  3. Ingwannu commented on Nov 7, 2026

    @Ingwannu
    Owner

    Thanks for the detailed report. The client-side change checks out: codex-cli 0.166.0 contains the new ModelProviderMismatch resume error ("This chat uses {provider}, but your current provider is {current}. Switch to {provider} to continue.", openai/codex codex-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-16 on dev (aaa3c20f3f): it keeps the root openai_base_url override next to model_provider = "opencodex" and relies on paginated openai-tagged threads resuming through Codex's built-in openai entry, 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 active model_provider, a home with both paginated openai threads and opencodex threads 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.

  4. lidge-jun commented on Nov 10, 2026

    @lidge-jun
    Owner

    Still reproduces on dev: src/codex/inject/paginated-openai-compat.ts keeps the root openai_base_url override and relies on paginated openai-tagged threads resuming through Codex's built-in openai entry, and codex-cli ≥ 0.166 now refuses that with ModelProviderMismatch. A home with both paginated openai threads and opencodex threads cannot reach both under one provider-table configuration.

    Owner decision on the direction:

    1. Detect and refuse: when the resolved Codex is ≥ 0.166 and paginated openai rows exist, refuse the authless transition with a message that states the trade-off (those threads cannot be resumed under opencodex). No data is touched. This stops the silent stranding.
    2. Native-writer-coordinated relabel: relabel threads.model_provider and the rollout session_meta provider 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.
    3. Document only.

    Recommendation: 1 now, so no new home strands its threads, and 2 as a designed follow-up.

  5. lidge-jun commented on Nov 10, 2026

    @lidge-jun
    Owner

    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.

  6. added a commit that references this issue on Nov 11, 2026
    a086231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugproxy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions