anomalyco / anomalyco/opencode
[Bug] "reasoning part 2 not found" error with Claude Opus 5 extended thinking (Anthropic provider)
@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
- Configure OpenCode with
providerID=anthropic,modelID=claude-opus-5, extended thinking enabled - Send a prompt
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.