Skip to content

Fetch models from models_gateway and prefer gateway-served models in picker #1606

Description

@ThePlenkov

Summary

When a models_gateway is configured, cagent currently assumes gateway supports core providers and shows a static list (configured models + models.dev catalog). It does not query the gateway for a live list of models. This causes incorrect/irrelevant models to appear in the model picker.

Proposal

Add gateway model discovery when models_gateway is set: query <gateway>/v1/models (OpenAI-style) or a configurable metadata endpoint and use the returned model list to populate/suppress models in the picker.

Acceptance criteria

  • When models_gateway is set and /v1/models returns a list, the model picker shows only models served by that gateway (merged with explicitly defined models in config).
  • Provide an opt-in config flag models_gateway.discover: true/false to control discovery.
  • Add unit tests and an integration test that mocks gateway responses.
  • Document behavior in AGENTS.md and README.md.

Notes

  • If gateway does not support /v1/models, fall back to current behavior.
  • Consider caching the model list and exposing a refresh button in the TUI.

Activity

  1. added
    area/agent
    area/tui
    on Mar 21, 2026
  2. added
    area/providers
    and removed on May 22, 2026
  3. added
    kind/feat
    on May 26, 2026
  4. added a commit that references this issue on Jun 12, 2026
    decb150
  5. added
    area/providers/docker-model-runner
    and removed
    kind/feat
    on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/agentarea/providersarea/providers/docker-model-runnerarea/tui

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions