Skip to content

app-server: profile-based model selector for custom providers - #1

Open
aristotaloss wants to merge 2 commits into
mainfrom
feature/profile-model-selector
Open

aristotaloss wants to merge 2 commits into
mainfrom
feature/profile-model-selector

Conversation

@aristotaloss

@aristotaloss aristotaloss commented Aug 28, 2026 •

Copy link
Copy Markdown

What

Config-defined profiles now show up in the GUI model picker — this is the model selector for custom providers that upstream's desktop app doesn't expose.

Profiles come from either source:

# ~/.codex/config.toml
[profiles.chinaland]
model = "deepseek-ai/deepseek-v4-flash"
model_provider = "nvidia"

or as profile layer files: ~/.codex/chinaland.config.toml with the same keys.

How it works

  • model/list appends one entry per profile (name = display name, description shows the real model · provider route). Real catalog models always win on name collision.
  • thread/start expands a selected profile name into its real model + model_provider (+ model_reasoning_effort via request overrides if the profile sets one). Full provider switch works for new threads.
  • turn/settings/update and thread/settings/update expand the model too, but reject profiles routing to a different provider with a clear error (providers are fixed per thread).

The desktop GUI already renders any non-hidden model/list entry in its picker, so no renderer patch is needed.

Verification

  • cargo check -p codex-app-server — clean
  • cargo check --tests -p codex-app-server — clean (existing suite type-checks against the changes)
  • cargo test execution not run: the monolithic tests/all.rs target OOMs (SIGKILL at link) in a 45GB sandbox. Needs a beefier runner or CI.
  • Not yet exercised end-to-end in a running desktop build (needs binaries from the codex-binaries workflow bundled via bitgate/CodexDesktop-Rebuild)

Notes

Kevin added 2 commits August 28, 2026 08:38
Profiles ([profiles.<name>] in config.toml or <name>.config.toml in
CODEX_HOME) now appear as model/list entries so desktop/app clients get
a working model selector for custom providers without hand-writing a
model catalog.

- profiles.rs: discovery (legacy table + profile files) and expansion
- models.rs: synthesize picker presets from profiles
- thread/start: expand a selected profile into model + model_provider
  (+ model_reasoning_effort via request overrides)
- turn/settings/update, thread/settings/update: expand model/effort;
  reject cross-provider profiles with guidance since providers are
  fixed per thread
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