经常运行到一半突然报错,然后结束工作 #6753

Closed
opened 2026-02-16 18:05:09 -05:00 by yindo · 1 comment
Owner

Originally created by @GXX182 on GitHub (Jan 18, 2026).

Originally assigned to: @fwang on GitHub.

Description

AI_TypeValidationError: Type validation failed: Value:
{
"code": "The service is currently unavailable",
"error": "Service temporarily unavailable. The model is at capacity and currently cannot serve this request. Please try again later."
}

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"
}

Image 是现在用的人太多了吗

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @GXX182 on GitHub (Jan 18, 2026). Originally assigned to: @fwang on GitHub. ### Description AI_TypeValidationError: Type validation failed: Value: { "code": "The service is currently unavailable", "error": "Service temporarily unavailable. The model is at capacity and currently cannot serve this request. Please try again later." } 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" } <img width="1232" height="115" alt="Image" src="https://github.com/user-attachments/assets/4b91cfb7-a8c5-4aad-adbf-4879a120bb91" /> 是现在用的人太多了吗 ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bugzen labels 2026-02-16 18:05:09 -05:00
yindo closed this issue 2026-02-16 18:05:10 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 18, 2026):

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

  • #7439: AIHubMix provider streaming error with ZodError (invalid_union) - similar type validation error during streaming
  • #1298: AI_TypeValidationError with invalid_union error - same error pattern when model returns unexpected response format
  • #2380: OpenCode immediately exits with orphaned processes - related to crashes and exits

The root cause appears to be related to model response validation failures (type validation errors with invalid_union) when the LLM provider returns an unexpected or malformed response, particularly when services are at capacity. These issues share:

  1. The same AI_TypeValidationError: Type validation failed error
  2. The same invalid_union code with expected fields not matching actual response
  3. Stream/response handling issues that cause the session to fail

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

@github-actions[bot] commented on GitHub (Jan 18, 2026): This issue might be a duplicate of existing issues. Please check: - #7439: AIHubMix provider streaming error with ZodError (invalid_union) - similar type validation error during streaming - #1298: AI_TypeValidationError with invalid_union error - same error pattern when model returns unexpected response format - #2380: OpenCode immediately exits with orphaned processes - related to crashes and exits The root cause appears to be related to model response validation failures (type validation errors with invalid_union) when the LLM provider returns an unexpected or malformed response, particularly when services are at capacity. These issues share: 1. The same `AI_TypeValidationError: Type validation failed` error 2. The same `invalid_union` code with expected fields not matching actual response 3. Stream/response handling issues that cause the session to fail Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6753