Skip to content

AI_TypeValidationError on Grok Fast 1 (Opencode Zen mode) #5759

Closed

Description

@mynameistito

Description

Description

When using the Grok Fast 1 model in Opencode Zen mode, the application throws a AI_TypeValidationError.

It appears that when the Grok API returns a "Service Unavailable" response, the error payload does not conform to the expected schema defined in the Opencode validation logic. Specifically, the validator expects an object for the error field or an array for choices, but receives a flat string within the error field instead.

Steps to Reproduce

  1. Open Opencode.
  2. Select the Grok Fast 1 - Opencode zen model.
  3. Send any prompt.
  4. The UI/Console returns the AI_TypeValidationError.

Error Logs

AI_TypeValidationError: Type validation failed: Value: {"code":"The service is currently unavailable","error":"Service temporarily unavailable. The model did not respond to this request."}.
Error message: [{"code":"invalid_union","errors":[[{"expected":"array","code":"invalid_type","path":["choices"],"message":"Invalid input: expected array, received undefined"}],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input: expected object, received string"}]],"path":[],"message":"Invalid input"}]

System

OS: Windows 10
OpenCode Version: 1.0.167
Node: 25.2.1
Method: TUI via Windows Terminal

Activity

  1. github-actions commented on Dec 18, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Collaborator

    that error comes from xai we can parse and retry automatically tho

  3. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Collaborator

    Should retry in next release automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindowszenRelates to Zen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions