Under opencode 2, live thinking streams as answer text and turns grey only when it ends #177
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in run 67, the first run on opencode 2 (#171) and llama.cpp. With Show thinking on, a thought streams onto the screen in white, like answer text. It turns grey, as a thought, only when the model moves on to its next statement. The Thinking indicator is not shown while it streams.
Cause
It's the opencode 2 adapter, not llama.cpp: opencode 2 tags the stream as reasoning (
session.reasoning.delta).kind. Measured on run 67's live stream: 400 of 400 frames for partprt_…-reasoning-0hadkind: "", so the console drew them as answer text.kindcame frommessage.part.updated, which opencode sent for a part before its first delta. The delta buffer remembered the type from it.src/osf/agent/v2.py's delta handler turnssession.reasoning.deltainto a 1.xmessage.part.deltawith onlyfield: "text", and drops the kind it was called with.session.reasoning.ended, the moment the part settles. That is the grey.Fix
The adapter's delta carries the kind it fills (
partType).DeltaFramekeeps it, and the delta buffer records it as it feeds the delta. Every frame then saysreasoningortext, including the first frame after a reconnect in the middle of a part.Announcing at
session.reasoning.startedinstead was considered. It would write an extra revision per part into the log, and a reconnect in the middle of a part would still miss the kind.Done when
Shipped in
55f376c(changelive-thought-from-its-first-word, commitdaa43d2), live since 23:32Z on 2026-10-16, and archived in2f7d842.partType).DeltaFramekeeps it askind, and the delta buffer records it as it feeds each delta.reasoningortextfrom the first word, a reconnect in the middle of a part included. opencode 1.x's deltas carry no type, and still use the part's announcement.run_01M53R7621CJW6PCZG7S6R94HS, thorough on cmoriarty/braid-combined-test, vLLM): openspec.explore's live frames were 174 reasoning and 8 text. openspec.propose.proposal had 247 reasoning. The two spec children had 294 and 15, and 359 and 12. agent.revise.operator had 344 and 7. No frame had an empty kind.Closing.