Skip to content

[bug] Custom OpenAI-compatible provider models are missing from model picker #444

Closed

Description

@alecuba16

Summary

Custom OpenAI-compatible provider profiles configured in ~/.jcode/config.toml with static [[providers.<name>.models]] entries are not shown in the TUI model picker. This makes the models hard or impossible to select from the picker, even though the provider profile is valid and can be used as the default provider/model.

Reproduction

Add a custom OpenAI-compatible provider profile:

[provider]
default_provider = "my-gateway"
default_model = "vendor/my-model"

[providers.my-gateway]
type = "openai-compatible"
base_url = "https://example.com/proxy/openai"
auth = "none"
default_model = "vendor/my-model"
provider_routing = false
model_catalog = false
allow_provider_pinning = false

[[providers.my-gateway.models]]
id = "vendor/my-model"
context_window = 230000
input = ["text"]

Then open the TUI model picker.

Actual behavior

The configured custom provider model does not appear in the TUI model picker, so it cannot be selected from the list.

The profile itself is valid. jcode provider current can resolve the configured default provider/model, and the model can be used if already selected by config or passed explicitly.

Expected behavior

Models declared under [[providers.<name>.models]] should appear in the model picker with a route back to that provider profile, for example:

  • model: vendor/my-model
  • provider: my-gateway
  • api method: openai-compatible:my-gateway

Text-capable configured models should be selectable the same way built-in OpenAI-compatible profile models are selectable.

Notes

This appears to be a model picker/catalog routing gap. Built-in OpenAI-compatible profiles are added to the picker, but arbitrary user-defined [providers.<name>] profiles are not included unless they are active through another path.

I prepared a fix branch that adds route generation for custom named provider profiles and includes a unit test:

https://github.com/alecuba16/jcode/tree/fix-custom-provider-model-picker

Commit:

alecuba16@50266321

Activity

  1. changed the title [-]Custom OpenAI-compatible provider models are missing from model picker[/-] [+][bug] Custom OpenAI-compatible provider models are missing from model picker[/+] on Jul 4, 2026
  2. hiSandog commented on Jul 6, 2026

    @hiSandog

    A useful test here would cover both the normal ~/.jcode/config.toml path and the edge case from this report. That should make it clear whether the fix belongs in input normalization/validation, configuration forwarding, or the lower-level execution path.

  3. alecuba16 commented on Jul 6, 2026

    @alecuba16
    ContributorAuthor

    Addressed in 61b44001. Added two end-to-end tests that exercise the full config.toml -> route generation flow:

    • custom_provider_models_appear_via_config_file: the normal ~/.jcode/config.toml path, verifying text-capable + default models surface in the picker while image-only models are excluded.
    • custom_provider_route_matches_issue_444_reproduction: the exact edge case from the report (provider_routing=false, model_catalog=false, allow_provider_pinning=false) to pin that the fix is in route generation / config forwarding, not input normalization/validation or the execution path.

    Both write a real TOML file to \$JCODE_HOME/config.toml, invalidate the config cache, and build routes through MultiProvider::model_routes() — the same path a real user hits. All 7 catalog_routes tests pass.

  4. added
    bug
    priority: medium
    triage: fixed-pending-release
    autonomous: likely
    on Jul 6, 2026
  5. 1jehuang commented on Jul 6, 2026

    @1jehuang
    Owner

    Triage: confirmed. Named [providers.<name>] config profiles only contributed routes when they were the active provider; static [[providers.<name>.models]] entries were never surfaced otherwise.

    Fixed on master in af1df25:

    • Picker route generation now includes named config profiles: text-capable [[providers.<name>.models]] entries (plus default_model fallback) appear with provider = <name>, api_method = openai-compatible:<name>. Image-only models (input = ["image"]) are excluded.
    • Selecting the emitted <name>:<model> spec binds the named profile runtime (new set_model_on_named_provider_profile path).
    • default_provider = "<name>" in config also binds the profile directly now, instead of routing through the generic OpenRouter slot (same silent-fallback class as default_provider = "deepseek" with default_model = "deepseek-v4-pro" silently falls back to Claude on startup #448).

    An end-to-end test covers your exact reproduction config (picker presence, image-only exclusion, spec selection, and config default binding). Will close automatically on the next release.

  6. 1jehuang commented on Jul 7, 2026

    @1jehuang
    Owner

    Released in v0.37.0. Run jcode update to get it.

  7. removed
    triage: fixed-pending-release
    on Jul 7, 2026
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

    autonomous: likelybugpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions