anomalyco / anomalyco/opencode

[Bug] "reasoning part 2 not found" error with Claude Opus 5 extended thinking (Anthropic provider)

Open
#40,939 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 6, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When using Claude Opus 5 with the Anthropic provider, OpenCode intermittently throws a "reasoning part 2 not found" error within 2–8 seconds of stream start. The error is displayed in the TUI as a red-bordered message instead of the model response. The turn is lost and must be retried.

Steps to reproduce

  1. Configure OpenCode with providerID=anthropic, modelID=claude-opus-5, extended thinking enabled
  2. Send a prompt
  3. Observe: TUI shows + Thought: Xms (reasoning block received), then displays "reasoning part 2 not found" as the assistant response

Expected behavior

The text response following the reasoning block is received and displayed normally.

Actual behavior

Stream starts, reasoning block (part 1) is received and shown as + Thought: ~94ms, but part 2 (the text response) is not found. The error string "reasoning part 2 not found" is shown in the TUI with a red/pink left border.

Logs

timestamp=2026-08-06T17:26:30.604Z level=ERROR message=process providerID=anthropic modelID=claude-opus-5 error="reasoning part 2 not found" stack=undefined
timestamp=2026-08-06T18:54:08.042Z level=ERROR message=process providerID=anthropic modelID=claude-opus-5 error="reasoning part 2 not found" stack=undefined
timestamp=2026-08-06T22:22:49.818Z level=ERROR message=process providerID=anthropic modelID=claude-opus-5 error="reasoning part 2 not found" stack=undefined
timestamp=2026-08-06T22:23:56.903Z level=ERROR message=process providerID=anthropic modelID=claude-opus-5 error="reasoning part 2 not found" stack=undefined

4 occurrences on 2026-08-06. Fail time: 2–8 seconds after stream start.

Environment

  • OpenCode version: 1.18.14
  • Provider: Anthropic (native, not OpenAI-compatible)
  • Model: claude-opus-5
  • Platform: macOS (darwin)

Related

Distinct from #40147 (that covers truncated reasoning being replayed on resume — this is a failure to receive the text part during the initial stream).

🤖 Generated with OpenCode (Claude)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.