Skip to content

Desktop app model picker never lists BYOK providers from providers.json (CLI does) #954

Description

@vncsleal

Summary

BYOK providers declared in ~/.commandcode/providers.json load in the CLI but are completely invisible in the desktop app model picker. The config is valid; the desktop never reads it.

Repro

  1. Declare a BYOK provider in ~/.commandcode/providers.json (tested with OpenCode Go: baseURL: https://opencode.ai/zen/v1, wire openai-completions, plus per-model "api": "openai-responses" overrides).
  2. Store the key in ~/.commandcode/auth.json under the provider id.
  3. CLI: cmd --list-models lists all 28 provider models under an OpenCode Go (byok) heading, with no config warnings. A real call succeeds: cmd -p "..." --model opencode-go/deepseek-v4.1-flash.
  4. Desktop: open the model picker (/model or Option+P). The Go models are absent. Only the hardcoded Command Code catalog is listed.

Root cause

fetchModels() in out/main/index.js builds the picker from getModelGroupsInOrder() → getAllModelOptions() → MODEL_OPTIONS, plus the static CMD_PROVIDER_REGISTRY. The harness code that reads the user providers file (loadProvidersConfig / createDeclarativeProviderModules) is not referenced anywhere in the desktop bundle — 0 occurrences, vs. 8 providers.json and 32 byok references elsewhere in the same file.

So the desktop picker can never surface a declarative provider, regardless of config. This is not a stale-cache or restart issue: the harness does support BYOK, and the desktop ships that same harness as a dependency.

Worth noting the boundary is narrow: the desktop does delegate agent turns to the CLI (ipcMain.handle("spawn-cli") → runAgentTurn, passing -m). A BYOK model would therefore run correctly if the picker could select one — the gap is specifically the hardcoded catalog, not the run path.

Requested behavior

Merge declarative BYOK providers into the desktop model list, grouped under their own heading, with the active session switchable to them — matching /model in the CLI.

Two adjacent gaps, for whoever picks this up:

Environment

  • command-code (CLI) 1.69.0
  • Command Code Desktop 0.1.42 (macOS, arm64)
  • Both read the same ~/.commandcode/providers.json

Config used is available on request.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions