Skip to content

multiple reasoning_opaque values received in a single response. Only one thinking part per response is suported #51466

Closed

Description

@svatos-jirka

Description

this messgae is shown very often:
multiple reasoning_opaque values received in a single response. Only one thinking part per response is suported

provider github; agent opus 5.5.

Plugins

No response

OpenCode version

1.18.32

Steps to reproduce

  1. normal work
  2. the msg "multiple reasoning_opaque values received in a single response. Only one thinking part per response is suported" is thown and opencode stops work

Screenshot and/or share link

No response

Operating System

windows 11

Terminal

windows terminal

Activity

  1. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor
  2. xiangyang-95 commented on Sep 28, 2026

    @xiangyang-95

    I met the same problem as well using opencode with Opus 5.5. This only start happening a few days ago.

  3. param087 commented on Sep 30, 2026

    @param087

    Root cause and a fix: #52190.

    This is interleaved thinking. Claude Opus 5/5.5 and Fable 5.1 on Copilot emit a fresh signed reasoning_opaque before each tool call, so one streamed response legitimately carries several. openai-compatible-chat-language-model.ts treats the second one as a protocol violation and throws, aborting the turn — which is why it presents as "stops working during normal work" rather than tying to a specific action. Any multi-tool-call turn with thinking on will do it.

    Worth noting for #17011, which was closed as not-reproducible: the trigger is multiple tool calls in a single assistant response, not a particular prompt. That is probably why it resisted repro.

    The parser is also stricter than the converter that feeds it — convert-to-openai-compatible-chat-messages.ts already handles multiple opaque values with a first-wins rule (if (partOpaque && !reasoningOpaque)) instead of erroring. The PR makes the parser consistent with that, and adds a fixture-based regression test that fails on dev with exactly this error and passes with the fix.

    Repro as a unit test, no account or network needed:

    data: {"choices":[{"index":0,"delta":{"reasoning_text":"..."}}]}
    data: {"choices":[{"index":0,"delta":{"tool_calls":[...],"reasoning_opaque":"opaque-first"}}]}
    data: {"choices":[{"index":0,"delta":{"reasoning_text":"..."}}]}
    data: {"choices":[{"finish_reason":"tool_calls","index":0,"delta":{"tool_calls":[...],"reasoning_opaque":"opaque-second"}}]}
    

    The second reasoning_opaque throws.

  4. kaminski-dev commented on Oct 4, 2026

    @kaminski-dev

    Hey, I hit the same error on 1.18.34, macOS, Opus 5.5. This device is a company notebook. I OAuth login via github.com.

    Here is how I reached the chat-completions path: GET https://api.githubcopilot.com/models is blocked by our internal Zscaler (307 to a block page), while POST /chat/completions on the same host is allowed. opencode swallows the failed /models call in packages/opencode/src/plugin/github-copilot/copilot.ts and falls back to the static catalogue, which puts Claude on chat-completions instead of the Messages API (api.npm becomes @ai-sdk/github-copilot instead of @ai-sdk/anthropic, visible with opencode models github-copilot --verbose). With Opus 5.5 and thinking on, the stream then carries one reasoning_opaque per tool call and the parser throws. Any multi-tool turn does it.

    I tested the fix on my company notebook using the branch version. Calling multiple tools as well as subagents works, and across multiple threads I didn't get this issue at all.

    Fix PR: #53191. It would also help to log the failed /models call instead of swallowing it, so this fallback isn't silent.

  5. kaminski-dev commented on Oct 5, 2026

    @kaminski-dev

    Hey @kitlangton, let me know if you find a second to check it.

  6. rekram1-node commented on Oct 7, 2026

    @rekram1-node
    Collaborator

    will look.

  7. rekram1-node commented on Oct 9, 2026

    @rekram1-node
    Collaborator

    updating:

    • models.dev to say the anthropic models can use anthropic sdk
    • chat parser to match vscode impl (on v1 and v2)
  8. rekram1-node commented on Oct 9, 2026

    @rekram1-node
    Collaborator

    next release of v1 and v2 should fix.

    Note, recommend updating to v2:
    https://opencode.ai/v2/docs

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