Skip to content

Inconsistent AI_TypeValidationError when submitting requests #5031

Closed

Description

@keegabit

Description

This is my first time using OpenCode so apologies if I'm not clear as I am still learning how to use it.

Immediately after I set up Zen, I selected Grok Code Fast 1, I ran /init in planning mode on my empty project and got this:

AI_TypeValidationError: Type validation failed: Value: {"code":"Some resource has been exhausted","error":"Channel xcode-0828-joint-klfix-lap7-unified-zpw7m-0 is overloaded: load=599414, num_requests=11"}.
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"}]

I ignored it, and continued to plan with no issues.
After I switched to build mode, it worked well until it seemed to have finished.

AI_TypeValidationError: Type validation failed: Value: {"code":"Some resource has been exhausted","error":"Channel xcode-0828-joint-klfix-lap7-unified-cnwmr-0 is overloaded: load=944000, num_requests=11"}.
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"}]

It seems a bit inconsistent because I tried it in a new project and instance with no issues.

OpenCode version

1.0.129

Steps to reproduce

  1. Start opencode in a new project
  2. Select Grok Code Fast 1
  3. run /init in planning mode

Screenshot and/or share link

Image Image

Operating System

MacOS Sequoia 15.6.1

Terminal

Ghostty

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 3, 2025
  2. self-assigned this
    on Dec 3, 2025
  3. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 3, 2025
  4. rekram1-node commented on Dec 3, 2025

    @rekram1-node
    Collaborator

    This is grok having scaling issues, this morning I merged a fix so that we will properly retry it, they arent sending error status codes tehy are sending a 200 but then streaming this error chunk.

    So i merged some logic to handle that, itll be in the next release

  5. keegabit commented on Dec 3, 2025

    @keegabit
    Author

    @rekram1-node Sweet, thank you! Could you possibly link the PR so I can take a look if its not too much trouble?

  6. rekram1-node commented on Dec 3, 2025

    @rekram1-node
    Collaborator

    It's pretty "dumb": 91db82c

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 working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions