Skip to content

AI_InvalidResponseDataError: Multiple reasoning_opaque values in single response (github-copilot + claude-sonnet-4-6) #17011

Closed as not planned

Description

@zdknet-0rgon

Bug Report

Version: v1.2.24
Provider: github-copilot
Model: claude-sonnet-4-6 (thinking enabled)

Error

AI_InvalidResponseDataError: Multiple reasoning_opaque values received in a single response. Only one thinking part per response is supported.

Root Cause

In the GitHub Copilot streaming handler, when Claude makes multiple parallel tool calls in agentic mode, the streaming response can send multiple reasoning_opaque delta chunks. The current guard throws instead of concatenating:

if (delta.reasoning_opaque) {
  if (reasoningOpaque != null) {
    throw new InvalidResponseDataError({ ... });
  }
  reasoningOpaque = delta.reasoning_opaque;
}

Suggested Fix

Concatenate instead of throwing:

if (delta.reasoning_opaque) {
  reasoningOpaque = (reasoningOpaque ?? "") + delta.reasoning_opaque;
}

Impact

  • Breaks all agentic sessions using extended thinking with github-copilot provider
  • Any response with parallel tool calls triggers this error
  • Workaround: binary-patch the binary (not ideal)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 11, 2026
  2. rekram1-node commented on Mar 26, 2026

    @rekram1-node
    Collaborator

    Can anyone provide steps to reproduce?

  3. mortalYoung commented on Mar 30, 2026

    @mortalYoung

    Same Problem Here.

    with model claude-sonnet-4.6(thinking enabled) and provider github-copilot too

  4. rekram1-node commented on Apr 3, 2026

    @rekram1-node
    Collaborator

    Can anyone please provide steps to reproduce or if not can u please provide a log of it by sending me:

    opencode export > session.json this is a terminal command to run, select the session u got it in, then send me file.

  5. rekram1-node commented on Apr 11, 2026

    @rekram1-node
    Collaborator

    If anyone can do this plz dm me on x or discord, or join our discord and @ me.

  6. rekram1-node commented on Apr 15, 2026

    @rekram1-node
    Collaborator

    I switched github copilot to use messages api, ig if u still see this type of thing. Just do as mentioned above, closing as cant repro for now.

  7. bjornsnoen commented on Jul 3, 2026

    @bjornsnoen

    Getting this error now when trying to use fable 5 via github-copilot. I've attached the session log as requested. I'm not allowed to reopen the issue, but it's definitely the same one @rekram1-node

    session.json

  8. mikybz commented on Sep 30, 2026

    @mikybz

    Great work! I get the same issue locally with sonnet 5.5, and are waiting for the PR to merge.
    Seems like the PR need an updated description according to a template before it can be merged.

  9. arweenushka commented on Oct 23, 2026

    @arweenushka

    getting same error with Claude Opus 5.5 and opencode

  10. rekram1-node commented on Oct 24, 2026

    @rekram1-node
    Collaborator

    Should be impossible on latest versions of opencode, perhaps ur on a much older version?

    Most v2 versions contain patch

  11. arweenushka commented on Oct 25, 2026

    @arweenushka

    you are right. i had opencode version 1.8

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions