Skip to content

[1/1 Live model routing] Select backends behind a fixed Codex model - #161

Merged
Gaebabi merged 4 commits into
mainfrom
fix/custom-provider-selection
Nov 11, 2026
Merged

Gaebabi merged 4 commits into
mainfrom
fix/custom-provider-selection

Conversation

@Gaebabi

@Gaebabi Gaebabi commented Nov 11, 2026

Copy link
Copy Markdown
Owner

A running Codex retains its startup model catalog, so changing provider models cannot update that picker in place. This change exposes one stable codex-switch model/default and moves actual OpenAI/custom model selection to a direct dropdown on Switch Home and provider setup.

Selection applies globally to new requests using the virtual model. The gateway snapshots the actual model, destination, key and reasoning default before body upload, retains them through streams/retries, and refuses a duplicate native turn request instead of retargeting it after a selection change. Missing/deleted targets fail explicitly. Original OpenAI authentication, native image routes, history/image compatibility guards and older custom aliases are retained. An existing connection upgrades only through explicit Connect; initial activation still needs one idle Codex restart. Later selections, saved reasoning defaults and newly added providers do not rewrite the fixed catalog or restart Codex.

Validation:

  • 292 provider/current-native-CLI contracts with exact 0.167.0-alpha.3.2: same app-server and chat route A/B/OpenAI, use a provider added after startup, and change reasoning defaults while its native model list remains fixed.
  • Actual loopback cases preserve A during body upload/streaming/retries while subsequent requests use B; cover persisted/deleted selection, cross-selection duplicate refusal, image input refusal and malformed discovery without vault loss.
  • 124 offscreen production WPF checks, 350 account/recovery checks, 42 language API checks and nine catalogs of 535 messages; Windows and shared desktop builds pass.
  • Scoped repository/link/localization/privacy checks pass. First activation, the personal native picker, real external-provider inference and a public binary release remain separate acceptance states. The owner's running Codex was untouched.

Application-component evidence uses fictional data and is rendered from the production controls offscreen; it is not a native owner-window capture. Before setup / scope and source hashes.

Actual-model setup

Home model dropdown

Refs #138; its broader desktop/provider acceptance remains open.

…ection

Keep provider save feedback separate from Codex connection state. Supply an
explicit private catalog without changing the original OpenAI provider identity,
and bound repeated native turn requests to prevent duplicate upstream inference.
Use a two-step provider editor with encrypted draft and selection persistence.
Load saved fields without treating a displayed key as a replacement, and add
explicit reveal, copy, reload and reuse actions. Keep save failures editable and
route a requested restart through the existing owner flow after the dialog closes.
Keep one Codex-facing model and persist the actual model choice in Switch.
Pin admission, streaming and retry snapshots while retaining legacy routes,
history/image guards, original sign-in and reversible connection setup.

@Gaebabi Gaebabi left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Author self-review of 04ee1ea (not an independent approval). Reviewed fixed-catalog/default bootstrap and reversible restoration, the global actual-model scope, saved selection and discovery-cache validation, admission before upload, model/key/reasoning snapshots through streams and bounded retries, cross-selection native duplicate refusal, existing route/auth/image/history guards, recovery selection identity and both desktop menus. No dependency/workflow or owner-data changes are included.

All six latest protected contexts pass on current main. Local verification passes 292 provider/current-native-CLI contracts, 124 offscreen WPF checks, 350 account/recovery checks and 42 language API checks with nine 535-message catalogs and both desktop builds. The same current native process/chat routes to A/B/OpenAI and a provider added after startup without changing its model list. The attached pictures are fictional production-component renders. Personal Codex picker/external-provider acceptance and a public binary release remain separate. The owner authorized CI-gated merge and local Switch update while preserving live Codex; initial owner connection/restart is deferred.

@Gaebabi
Gaebabi merged commit c72b4a9 into main Nov 11, 2026
6 checks passed
@Gaebabi
Gaebabi deleted the fix/custom-provider-selection branch November 11, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant