Summary
Some models return extended thinking / chain-of-thought tokens (e.g., Claude with extended thinking enabled). The native runtime currently silently drops these. They should be captured in session state and optionally displayed.
What OpenCode does
OpenCode processes reasoning-start/delta/end stream events, persists reasoning parts to the database, and provides a /thinking toggle to show/hide them in the TUI.
Proposed implementation
- In
mergeStreamChunk() (openrouter.go), detect and accumulate reasoning content from stream deltas
- Store reasoning tokens in the message alongside content (e.g., a
Reasoning field on the Message struct)
- Persist in state.json for debugging and replay
- Emit reasoning as a separate event type in session events.jsonl
- Surface via
toc runtime watch and Conductor UI
Priority
P1 — important for debugging agent behavior and supporting reasoning-heavy models
🤖 Generated with Claude Code
Summary
Some models return extended thinking / chain-of-thought tokens (e.g., Claude with extended thinking enabled). The native runtime currently silently drops these. They should be captured in session state and optionally displayed.
What OpenCode does
OpenCode processes
reasoning-start/delta/endstream events, persists reasoning parts to the database, and provides a/thinkingtoggle to show/hide them in the TUI.Proposed implementation
mergeStreamChunk()(openrouter.go), detect and accumulate reasoning content from stream deltasReasoningfield on the Message struct)toc runtime watchand Conductor UIPriority
P1 — important for debugging agent behavior and supporting reasoning-heavy models
🤖 Generated with Claude Code