Skip to content

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

Description

@pzam-ai

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)

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