Skip to content

Cerebras GLM 4.7 #7442

Closed
Closed

Description

@franz-see

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

Activity

  1. github-actions commented on Jan 9, 2026

    @github-actions
    Contributor

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

    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.

  2. goniz commented on Jan 9, 2026

    @goniz
    Contributor

    I suggest updating OpenCode and trying again

  3. franz-see commented on Jan 9, 2026

    @franz-see
    Author

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

  4. goniz commented on Jan 9, 2026

    @goniz
    Contributor

    @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.

  5. franz-see commented on Jan 9, 2026

    @franz-see
    Author

    @goniz that works!! thanks! 🙌

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