Skip to content

fix(models): hide unauthenticated providers#33

Merged
mydisha merged 2 commits into
mydisha:mainfrom
bobbyunknown:fix/auth-gated-model-discovery
Jul 3, 2026
Merged

fix(models): hide unauthenticated providers#33
mydisha merged 2 commits into
mydisha:mainfrom
bobbyunknown:fix/auth-gated-model-discovery

Conversation

@bobbyunknown

Copy link
Copy Markdown
Contributor

What

Gate model discovery so /v1/models, /v1/models/{kind}, and /v1/models/info only expose models from providers that the tenant has authenticated and can use.

Why

This is related to #32. The OpenCode plugin added there fetches models from /v1/models; without this backend filter, OpenCode sees many catalog models from providers that have no configured auth/account, causing unusable models to appear in the picker.

How

  • Added provider gating based on tenant accounts.
  • Excludes providers whose account is disabled or marked NeedsReconnect.
  • Keeps tenant-owned chains visible.
  • Deduplicates static and live-discovered model entries.
  • Applies the same gate to model metadata lookup and returns 404 for unconnected providers to avoid leaking provider availability.
  • Added gateway tests for connected providers, disabled/reconnect accounts, chains, kind-filtered discovery, and model info gating.

Verification

  • go test ./backend/internal/gateway
  • go test ./backend/...
  • Live local check: only configured Mimo providers were returned from /v1/models; unconfigured anthropic, openai, and kiro model info probes returned 404.

@mydisha

mydisha commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Thanks for the findings, merged to main @bobbyunknown 🔥

@mydisha mydisha merged commit 389ef80 into mydisha:main Jul 3, 2026
3 checks passed
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.

2 participants