Cerebras GLM 4.7 #4492

Closed
opened 2026-02-16 17:44:21 -05:00 by yindo · 5 comments
Owner

Originally created by @franz-see on GitHub (Jan 9, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

In my linux cachyos, I have opencode 1.0.162. When I do a simple hi with Cerebras GLM 4.7, I get the following

(Note: I do not see this issue in my mac with opencode 1.0.220)

[
  {
    "code": "invalid_union",
    "errors": [
      [
        {
          "expected": "string",
          "code": "invalid_type",
          "path": [
            "reason"
          ],
          "message": "Invalid input: expected string, received object"
        }
      ],
      [
        {
          "expected": "object",
          "code": "invalid_type",
          "path": [
            "part"
          ],
          "message": "Invalid input: expected object, received undefined"
        },
        {
          "expected": "string",
          "code": "invalid_type",
          "path": [
            "delta"
          ],
          "message": "Invalid input: expected string, received undefined"
        }
      ],
      [
        {
          "expected": "object",
          "code": "invalid_type",
          "path": [
            "part"
          ],
          "message": "Invalid input: expected object, received undefined"
        },
        {
          "expected": "string",
          "code": "invalid_type",
          "path": [
            "delta"
          ],
          "message": "Invalid input: expected string, received undefined"
        }
      ]
    ],
    "path": [],
    "message": "Invalid input"
  }
]

Plugins

No response

OpenCode version

1.0.162

Steps to reproduce

  1. Add cerebras key
  2. select Cerebras GLM 4.7
  3. prompt "hi"

Expected:
4. Works without issues

Actual:
4. Works but has a big JSON error. Looks like tool calling is not working when this happens

Screenshot and/or share link

No response

Operating System

Linux cachyos-x8664 6.17.1-3-cachyos

Terminal

kitty

Originally created by @franz-see on GitHub (Jan 9, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description In my linux cachyos, I have opencode 1.0.162. When I do a simple `hi` with Cerebras GLM 4.7, I get the following (_Note: I do not see this issue in my mac with opencode 1.0.220_) ``` [ { "code": "invalid_union", "errors": [ [ { "expected": "string", "code": "invalid_type", "path": [ "reason" ], "message": "Invalid input: expected string, received object" } ], [ { "expected": "object", "code": "invalid_type", "path": [ "part" ], "message": "Invalid input: expected object, received undefined" }, { "expected": "string", "code": "invalid_type", "path": [ "delta" ], "message": "Invalid input: expected string, received undefined" } ], [ { "expected": "object", "code": "invalid_type", "path": [ "part" ], "message": "Invalid input: expected object, received undefined" }, { "expected": "string", "code": "invalid_type", "path": [ "delta" ], "message": "Invalid input: expected string, received undefined" } ] ], "path": [], "message": "Invalid input" } ] ``` ### Plugins _No response_ ### OpenCode version 1.0.162 ### Steps to reproduce 1. Add cerebras key 2. select Cerebras GLM 4.7 3. prompt "hi" Expected: 4. Works without issues Actual: 4. Works but has a big JSON error. Looks like tool calling is not working when this happens ### Screenshot and/or share link _No response_ ### Operating System Linux cachyos-x8664 6.17.1-3-cachyos ### Terminal kitty
yindo added the bug label 2026-02-16 17:44:21 -05:00
yindo closed this issue 2026-02-16 17:44:21 -05:00
Author
Owner

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

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

  • #7439: AIHubMix provider: streaming completes output but errors near end with ZodError (invalid_union: reason/part/delta)
  • #5981: All Mistral models fail with ZodError: "finish" expected string, received object
  • #5759: AI_TypeValidationError on Grok Fast 1 (Opencode Zen mode)
  • #4951: imagen_generate tool crashes with validation error: expected string, received object
  • #1298: Getting an issue integrating a custom provider: AI_TypeValidationError, failed type validation

These issues share similar validation error patterns (invalid_union, invalid_type errors) and suggest a broader issue with how responses from certain AI providers are being validated. Feel free to ignore if your specific case differs.

@github-actions[bot] commented on GitHub (Jan 9, 2026): This issue might be a duplicate of existing issues. Please check: - #7439: AIHubMix provider: streaming completes output but errors near end with ZodError (invalid_union: reason/part/delta) - #5981: All Mistral models fail with ZodError: "finish" expected string, received object - #5759: AI_TypeValidationError on Grok Fast 1 (Opencode Zen mode) - #4951: imagen_generate tool crashes with validation error: expected string, received object - #1298: Getting an issue integrating a custom provider: AI_TypeValidationError, failed type validation These issues share similar validation error patterns (invalid_union, invalid_type errors) and suggest a broader issue with how responses from certain AI providers are being validated. Feel free to ignore if your specific case differs.
Author
Owner

@goniz commented on GitHub (Jan 9, 2026):

I suggest updating OpenCode and trying again

@goniz commented on GitHub (Jan 9, 2026): I suggest updating OpenCode and trying again
Author
Owner

@franz-see commented on GitHub (Jan 9, 2026):

@goniz 1.0.162 is the latest (at least with paru)

@franz-see commented on GitHub (Jan 9, 2026): @goniz 1.0.162 is the latest (_at least with paru_)
Author
Owner

@goniz commented on GitHub (Jan 9, 2026):

@goniz 1.0.162 is the latest (at least with paru)

Latest version is actually 1.1.8.
Since OpenCode has a very fast update rate, I suggest you uninstall the paru version and use the curl installer from OpenCode and the cli will take care of the updates for you.

@goniz commented on GitHub (Jan 9, 2026): > @goniz 1.0.162 is the latest (_at least with paru_) Latest version is actually 1.1.8. Since OpenCode has a very fast update rate, I suggest you uninstall the paru version and use the curl installer from OpenCode and the cli will take care of the updates for you.
Author
Owner

@franz-see commented on GitHub (Jan 9, 2026):

@goniz that works!! thanks! 🙌

@franz-see commented on GitHub (Jan 9, 2026): @goniz that works!! thanks! 🙌
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4492