Skip to content

Cerebras zai-glm-4.7 fails on follow-up turn with reasoning_content #26762

Closed

Description

@ryanl-cerebras

Description

Using cerebras/zai-glm-4.7 on newer OpenCode versions, multi-turn runs that include reasoning and tool calls can fail on a follow-up assistant turn with:

messages.2.assistant.reasoning_content: property 'messages.2.assistant.reasoning_content' is unsupported

I can reproduce this on opencode 1.14.41.

The same prompt worked for me on opencode 1.1.4, and it also works on a local patched build from current dev, so this looks like a regression in how prior assistant reasoning is replayed for Cerebras models.

Plugins

None

OpenCode version

1.14.41

Steps to reproduce

  1. Configure a Cerebras provider and use cerebras/zai-glm-4.7

  2. Run from a clean directory, for example mkdir inferencex && cd inferencex

  3. Run this prompt:

    build an frontend for inferencex performance benchmark

  4. Let the run continue into tool use and the next assistant turn

  5. Observe the error:

    messages.2.assistant.reasoning_content: property 'messages.2.assistant.reasoning_content' is unsupported

Screenshot and/or share link

Image

Operating System

macOS

Terminal

iTerm2

Activity

  1. github-actions commented on May 10, 2026

    @github-actions
    Contributor

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

    If your issue is the same underlying problem, please consider adding context there rather than opening a new report. If it is specific to the Cerebras provider or a distinct regression, feel free to clarify.

  2. WanderWang commented on May 11, 2026

    @WanderWang

    Same root cause here with Kimi K2.6 — multi-turn tool calls fail with "thinking is enabled but reasoning_content is missing" and then it loops forever. This has been happening for weeks across multiple versions (currently on 1.14.48). Tried disabling compaction and a few other workarounds but nothing fully solves it. Would really appreciate if this could get some attention, it is making OpenCode basically unusable with Kimi for me.

  3. ryanl-cerebras commented on May 11, 2026

    @ryanl-cerebras
    ContributorAuthor

    Thanks, this does look related to the broader reasoning_content replay issues in #19081, #25758, and #24722.

    In this case though, the Cerebras path is a little different from DeepSeek / Kimi. The failing repro here is cerebras/zai-glm-4.7, where follow-up turns break because prior assistant reasoning is being replayed in a shape that Cerebras does not accept. The PR I opened is a narrow provider-specific fix for that path:

    #26763

    So I think this issue is best understood as part of the same general replay/history problem, but with a Cerebras-specific fix rather than a full cross-provider solution.

  4. ryanl-cerebras commented on May 12, 2026

    @ryanl-cerebras
    ContributorAuthor

    I added explicit regression coverage for the hosted and reasoning replay path in #26763 as well.\n\n@WanderWang if you have a chance, could you try that PR branch with your Kimi K2.6 setup and let me know whether it fixes the follow-up turn failure on your side?

  5. ryanl-cerebras commented on May 12, 2026

    @ryanl-cerebras
    ContributorAuthor

    I added explicit regression coverage for the hosted Kimi K2.6 and GLM 4.7 reasoning replay path in #26763 as well.

    @WanderWang if you have a chance, could you try that PR branch with your Kimi K2.6 setup and let me know whether it fixes the follow-up turn failure on your side?

  6. ryanl-cerebras commented on May 12, 2026

    @ryanl-cerebras
    ContributorAuthor

    Small update here: I expanded #26763 beyond the Cerebras-specific path and patched the OpenAI-compatible fallback that defaults reasoning_content replay for the same issue family.

    That now explicitly covers Kimi and the GLM reasoning models we discussed, including Kimi K2.5, Kimi K2.6, Kimi K2 Thinking, GLM 5, GLM 5.1, and GLM 5V Turbo, with added provider-level tests.

    @WanderWang if you have a chance, could you try the PR branch with your Kimi K2.6 setup and let me know if it fixes the follow-up turn failure on your side?

  7. WanderWang commented on May 12, 2026

    @WanderWang

    @ryanl-cerebras thanks for the fix! Happy to test this with my Kimi K2.6 setup.

    I'll run tests tomorrow between 02:00–10:00 UTC (10:00–18:00 Beijing time) and report back by 10:00 UTC.

  8. real-limitless commented on Jun 10, 2026

    @real-limitless

    Is there any updates on this?

  9. slachiewicz commented on Jun 11, 2026

    @slachiewicz

    Really waiting for this to be fixed

  10. ryanl-cerebras commented on Jun 11, 2026

    @ryanl-cerebras
    ContributorAuthor

    @jlongster any chance we can get a review here?

  11. EricPedley commented on Jun 15, 2026

    @EricPedley

    Just ran into this issue and tested the #26763 fork and it does indeed fix the problem for me using GLM 4.7 on the cerebras API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions