You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI_TypeValidationError on Grok Fast 1 (Opencode Zen mode) #5759
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
Open Opencode.
Select the Grok Fast 1 - Opencode zen model.
Send any prompt.
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
github-actions commentedon Dec 18, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 18, 2025
that error comes from xai we can parse and retry automatically tho
rekram1-node commentedon Dec 18, 2025
Should retry in next release automatically