Skip to content

fix(oauth): offer xAI chat models returned by GET /v1/models - #844

Merged
vastsa merged 3 commits into
vastsa:mainfrom
feeeeling:fix/xai-live-model-list
Sep 22, 2026
Merged

vastsa merged 3 commits into
vastsa:mainfrom
feeeeling:fix/xai-live-model-list

Conversation

@feeeeling

@feeeeling feeeeling commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A signed-in xAI (Grok/X subscription) account now treats GET /v1/models as the list of conversation models it may use. grok-4.7 is offered as soon as Grok returns it, without waiting for the pinned pi-ai catalog to ship that id.
  • Image and video generators in that payload (grok-imagine-* and similar) stay out of the chat picker. If the request fails, the pinned catalog remains the fallback, so Copilot and the other static vendors are unchanged.
  • An id that models.dev does not know yet inherits context and thinking levels from the newest pinned sibling (grok-4.6, then 4.5, then 4.3) instead of the 128k generic shape.

Test plan

  • node --test test/vendor-oauth-login.test.mjs test/anthropic-oauth-retry.test.mjs (38 passing), including a login whose /models body contains grok-4.7 and grok-imagine-image
  • Sign in to xAI in Settings → Model configuration, refresh models, and confirm grok-4.7 is selectable and a turn no longer reports Vendor account does not offer model "grok-4.7"

The pinned pi-ai catalog stops at grok-4.6, so a signed-in Grok account
rejects grok-4.7 before the request is sent. When the account token can
read /v1/models, that chat-model list is the authority and the pinned
catalog is only the fallback.
Copilot AI lite review requested due to automatic review settings September 22, 2026 04:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa

vastsa commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Maintainer-side handling so this could be gated and landed:

  • The head's workflow runs were sitting in action_required (first-time contributor), so nothing had been validated; I approved them.
  • I merged the current main into the branch to satisfy Head contains latest base (head f3ece7fb), no force-push and no content changes.

Independent check of the premise: pi-ai 0.86.1's pinned xAI catalog ships only grok-4.3 / grok-4.5 / grok-4.6, so on main a signed-in xAI account really cannot select grok-4.7 — the change addresses a real gap. All four gates are green on the updated head.

@vastsa
vastsa merged commit afeb49d into vastsa:main Sep 22, 2026
4 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.

3 participants