Skip to content

xai-oauth model discovery hides newly released models (e.g. grok-4.6) #3116

Closed

Description

@Astro-Han

What happened

Connected xAI OAuth (SuperGrok / X Premium). The connection's model list does not include newly released Grok models — e.g. grok-4.6 — even though the account can use them and an xai API-key connection listing the same GET /v1/models endpoint shows them. Expected: the OAuth connection lists the chat models the account can use, including freshly released ones, without waiting for a local snapshot update.

How to reproduce

  1. Add an xAI OAuth connection (SuperGrok / X Premium) in Settings → Models, then let the model fetch complete (or trigger "re-fetch models" later).
  2. Open the connection's model list.
  3. Observe that grok-4.6 is absent, while an xai API-key connection (same https://api.x.ai/v1 base) lists it.

Environment

  • Maka version or commit: 8b79a6dae (main)
  • OS and version: macOS
  • Surface: Desktop
  • Node.js version: 24.18.1 (running from source)

Logs, screenshots, or additional context

Root cause. xai-oauth model discovery is configured with filter: 'fallback-models' in packages/core/src/provider-registry.ts:

'xai-oauth': {
  ...
  modelDiscovery: {
    kind: 'protocol',
    auth: 'oauth-bearer',
    filter: 'fallback-models', // ← id whitelist against the local snapshot
  },
},

filterDiscoveredModels (packages/runtime/src/model-fetcher.ts) keeps only ids present in fallbackModels = xaiModelIds, i.e. the tool-calling models from the bundled models.dev snapshot (GENERATED_MODELS_DEV_METADATA.xai, synced by scripts/sync-model-metadata.mjs). That snapshot currently tops out at grok-4.5 (lastUpdated: 2026-07-08), so a /models response containing grok-4.6 is silently filtered out. The xai API-key provider has no filter and therefore lists the model.

Why not switch to another filter. xAI's /models returns OpenAI-style entries (id/object/created/owned_by) without capability or type fields, so both remaining filter options would return an empty list for this provider:

  • filter: 'tool-capable' — reads capabilities.functionCalling from the response (absent)
  • filter: 'language-models' — reads type === 'language' from the response (absent)

Other OAuth/subscription providers that discover models server-side do not use a local whitelist: github-copilot filters on server fields (model_picker_enabled, policy.state, supports.tool_calls), openai-codex drops visibility: hide/hidden and sorts by server priority, and claude-subscription cannot discover at all (session-scoped token, /v1/models returns 401) so it uses kind: 'fallback'. xai-oauth is the only OAuth provider hard-pinning discovery to the local snapshot.

Proposed fix. Trust the server listing, matching xai / github-copilot / openai-codex:

modelDiscovery: { kind: 'protocol', auth: 'oauth-bearer' },

fallbackModels stays as the bootstrap fallback (before first fetch / on discovery failure) but stops acting as a hard cap. Add a regression test in packages/runtime/src/__tests__/model-fetcher.test.ts asserting that an id absent from the snapshot (e.g. grok-4.6) survives xai-oauth discovery.

Consideration. If the OAuth /models listing ever includes non-chat models (imagine/voice), a small negative exclude can be added later; the xai API-key path already surfaces the full listing today without reported issues.

Activity

  1. 1625567290 commented on Aug 16, 2026

    @1625567290
    Contributor

    I'm working on this. I'll drop the fallback-models discovery filter on xai-oauth so the server listing is trusted, and add a regression that an id absent from the local snapshot (e.g. grok-4.6) still survives fetch.

    Grok is assisting with the implementation; I will review the change and remain the human contributor of record.

    简体中文对照

    我来处理。去掉 xai-oauth 的 fallback-models 发现过滤,改信服务器列表,并加回归:本地 snapshot 里没有的 id(例如 grok-4.6)在 fetch 后仍然保留。

    Grok 协助实现;我会审阅改动,并作为 human contributor of record。

  2. added
    help wanted
    on Aug 16, 2026
  3. added a commit that references this issue on Aug 16, 2026
    8247798
  4. added a commit that references this issue on Aug 16, 2026
    dd02553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help wanted

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions