Skip to content

xai provider advertises xhigh variant its own SDK schema rejects #43226

Description

@guitaripod

Version

1.18.18 (Linux, x86_64)

What happens

Picking the xhigh effort variant for xai/grok-4.6 (offered in the picker, present in GET /config/providers) makes every prompt in that session fail instantly with:

AI_InvalidArgumentError: invalid xai provider options
AI_TypeValidationError: Invalid option: expected one of "none"|"low"|"medium"|"high" at path reasoningEffort

Payload opencode built: {"store":false,"promptCacheKey":"...","reasoningEffort":"xhigh"}

Why

Two of opencode's own halves disagree:

  1. The catalog advertises variants: { "xhigh": { "reasoningEffort": "xhigh" } } for grok-4.6 (and other post-2025-12 xAI models) — correctly, since xAI's API does support reasoning_effort: "xhigh" on grok-4.6 (docs.x.ai/docs/guides/reasoning).
  2. The bundled @ai-sdk/xai provider's zod schema accepts only none|low|medium|high for reasoningEffort, so the request dies at local type validation before any network call.

Expected

Either the schema accepts xhigh (xAI supports it on grok-4.6+) or the catalog stops advertising it. As shipped, the picker offers an option that can never run.

Repro

  1. opencode 1.18.18, xAI connected.
  2. /models → xai/grok-4.6, effort xhigh.
  3. Send any prompt → "invalid xai provider options".

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions