Skip to content

[Bug] Shadow call intercept model dropdown saves bare id for namespaced providers, silently breaking interception #1075

Closed

Description

@ShannwYang

Summary

In the dashboard's Shadow call intercept settings, the "Replacement model" dropdown persists the bare model id (gpt-5.6-sol) instead of the full namespaced id (subapi/gpt-5.6-sol) when a routed model is selected. The saved bare id then routes shadow calls to the built-in openai provider, silently breaking interception for users of custom/namespaced providers. On reload the dropdown also "jumps" to the native model with the same id.

Client or integration

Codex Desktop (embedded app-server 0.147.0-alpha.1.2) + Web dashboard (GUI) — macOS

Area

Shadow call intercept / GUI settings

Reproduction

  1. Open dashboard (http://localhost:10100) → Shadow call intercept settings.
  2. In "Replacement model", select a namespaced model such as subapi/gpt-5.6-sol.
  3. Save, then inspect ~/.opencodex/config.json → shadowCallIntercept.model is "gpt-5.6-sol" (bare), not "subapi/gpt-5.6-sol".
  4. Reload the page: the dropdown no longer shows the selected namespaced model (bare value matches the native OpenAI entry with the same id → UI jumps to a different model).

Expected behavior

Selecting subapi/gpt-5.6-sol should persist shadowCallIntercept.model = "subapi/gpt-5.6-sol" — the full namespaced id. The management API already accepts any string, so this is purely a GUI value/label mismatch.

Actual behavior

shadowCallIntercept.model is saved as the bare id (gpt-5.6-sol), which routes shadow calls to the built-in openai provider (causing 502/429 failures when chatgpt.com is unreachable), and the dropdown visually jumps to the native model with the same id on reload.

Version

  • opencodex 2.10.1 (also present in 2.10.0)
  • Codex Desktop 26.730.61639 / embedded CLI 0.147.0-alpha.1.2

Operating system

macOS arm64 (Apple Silicon)

Root cause

In the bundled GUI (gui/dist/assets/index-*.js), the shadow-call settings component builds the dropdown as:

options: [{ value: '', label: '—' }, ...c.map(e => ({
  value: e.id,                        // ← bare id
  label: `${e.provider}/${e.id}`      // ← namespaced label
}))]

value uses the bare e.id while label uses the namespaced id, so saving writes the bare id and reload matches the wrong option.

Suggested fix

Use the full namespaced id for the option value, matching the label:

options: [{ value: '', label: '—' }, ...c.map(e => ({
  value: `${e.provider}/${e.id}`,
  label: `${e.provider}/${e.id}`
}))]

Verified locally as a one-line patch on 2.10.1: the dashboard then persists the full subapi/gpt-5.6-sol and interception works correctly.

Workaround

Set shadowCallIntercept.model directly in ~/.opencodex/config.json (the management API accepts any string model id).

Activity

  1. github-actions commented on Aug 5, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: unknown.

  2. github-actions commented on Aug 5, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  3. added
    bug
    on Aug 5, 2026
  4. lidge-jun commented on Aug 6, 2026

    @lidge-jun
    Owner

    Confirmed at code level — thank you for the precise root cause, which pointed at exactly the right component. Two selects edit shadowCallIntercept.model:

    • gui/src/pages/Models.tsx:914 already uses the canonical namespaced value from /api/models — correct.
    • gui/src/pages/dashboard-overview-sections.tsx:363 builds options inline with value: m.id / label: provider/id — this is the bundle snippet you decompiled, and it saves the bare id.

    One correction to the suggested patch: the fix should use the API's canonical namespaced field rather than reconstructing ${provider}/${id}. Native OpenAI rows are deliberately bare slugs and routed rows go through a slug codec that encodes inner slashes (src/server/management/model-rows.ts, src/providers/slug-codec.ts), so string concatenation would mint noncanonical ids like openai/gpt-5.6-sol and bypass encoded aliases.

    One honest limitation: a previously saved bare id that collides with a native slug (your exact case) is indistinguishable from an intentional native pick, so the fix prevents new corruption but cannot repair old collisions — the workaround you documented (setting the namespaced id directly in config) remains the recovery path for existing configs.

    Fix PR with a regression test is in progress against dev. #1078 is closed as a duplicate of this issue.

  5. added a commit that references this issue on Aug 6, 2026
  6. lidge-jun commented on Aug 6, 2026

    @lidge-jun
    Owner

    Fixed on dev by PR #1087, merge commit bfbc9a4. Both shadow-call selects (dashboard overview and Models page) now save the proxy's canonical namespaced routing id, and an unmatched legacy value stays visible as a fallback option instead of the select jumping. As noted above, a previously saved bare id colliding with a native slug can't be auto-repaired — set the namespaced id once via the fixed dropdown (or config) and it will stick. Thanks again for the exact root cause; it made this a same-day fix. Ships with the next release train.

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

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions