Repository navigation
[NO-JIRA] Stream Claude thinking as it arrives instead of at block end - #20
Merged
Merged
Conversation
…ock_stop The Anthropic SSE parser accumulated thinking_delta and signature_delta and yielded the whole block at content_block_stop, so ACP clients saw nothing while the model thought and then the whole thought at once. Yield each thinking_delta as an unsigned Thinking block with the message id, and at content_block_stop yield only the signature. Conversation::push and collect_stream already merge unsigned deltas and adopt a trailing signature (upstream aaif-goose#9162), so storage still holds one signed block per thinking block. Omitted thinking (no deltas) still yields its signed empty block. The toolshim accumulator in reply_parts only joined text, so it gets the same thinking merge rules.
johnnymo87
added a commit
to johnnymo87/workstation
that referenced
this pull request
Nov 22, 2026
…es (#899) #### Description - Bumps pkgs/goose to patched-1.54.0.18, which adds patch 25 (johnnymo87/goose#20). The Anthropic SSE parser now yields each `thinking_delta` as it arrives instead of buffering the block until `content_block_stop`, so honk chat shows Claude's thinking before the reply instead of after ~10 s of silence. - Storage is unchanged: each thinking block is still stored once, signed. This was verified on Vertex claude-opus-5-5 across a follow-up turn, `/compact` and tool-call turns. - There is no schema change. goose-serve picks up the binary on a manual restart in a quiet window, or at the nightly reset. - All three asset hashes were prefetched from the release. The aarch64-linux package builds and passes its `--version` check. #### References - workstation-6w7i.25 - johnnymo87/goose#20
johnnymo87
added a commit
that referenced
this pull request
Nov 22, 2026
…ock_stop (#20) The Anthropic SSE parser accumulated thinking_delta and signature_delta and yielded the whole block at content_block_stop, so ACP clients saw nothing while the model thought and then the whole thought at once. Yield each thinking_delta as an unsigned Thinking block with the message id, and at content_block_stop yield only the signature. Conversation::push and collect_stream already merge unsigned deltas and adopt a trailing signature (upstream aaif-goose#9162), so storage still holds one signed block per thinking block. Omitted thinking (no deltas) still yields its signed empty block. The toolshim accumulator in reply_parts only joined text, so it gets the same thinking merge rules. Ported from 3a1f730 and 47c99a8 onto v1.60.2. Adaptation: resolved test conflict in anthropic.rs alongside upstream aaif-goose#13029; included Vertex summarized-thinking test from 47c99a8 (formats/gcpvertexai.rs); dropped 9180e7e (upstream aaif-goose#13029 already present); deferred CI workflow changes to dedicated CI commit.
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Claude thinking now streams to clients as it is generated, instead of arriving all at once when the thinking block ends. On cloudbox, honk chat sat silent for ~9 s and then got the whole thought in one
agent_thought_chunk, although Vertex streamsthinking_deltaevents the whole time.formats/anthropic.rsresponse_to_streaming_message: eachthinking_delta(and any initial text incontent_block_start) is yielded as an unsigned Thinking block carrying the message id. Atcontent_block_stoponly the signature is yielded. Omitted thinking (no deltas) still yields its signed empty block. Covers gcp_vertex_ai, anthropic, databricks_v2, kimicode, muse_code and declarative Anthropic-engine providers.Conversation::pushandcollect_streamalready merge unsigned deltas and adopt the trailing signature (upstream fix(goose): coalesce streaming Thinking deltas + list available tools on not-found aaif-goose/goose#9162), which is what made refactor(anthropic): fix N+1 thinking message storage issue aaif-goose/goose#7958's buffering necessary at the time and unnecessary now.reply_parts.rsonly joined text, so it gets the same thinking-merge rule.patched-release.yml's test-patches list.Verified on Vertex claude-opus-5-5 with the built CLI (isolated
GOOSE_PATH_ROOT), legacy loop andGOOSE_STATE_MACHINE=1: every assistant turn stored exactly one Thinking block with the joined text and signature; a second turn,/compact, a post-compact turn and a two-tool-call turn all replayed signed thinking with no API errors; requests still carrydisplay: summarized(#19). Cache-miss breaker (#17) and role effort (#18) tests pass.Behaviour change worth knowing: a turn cancelled or cut off mid-thinking now keeps the partial unsigned thinking, the same way partial text is already kept. Anthropic-family providers drop unsigned thinking on replay, so it does not reach the API.
No upstream equivalent exists: aaif-goose main still buffers (checked 2026-11-21). Porting to v1.60.2: the same edit applies; there the parser routes yields through
if held.is_empty() { yield } else { held.push(..) }(from aaif-goose#13226), and thinking deltas should use that same pattern. The toolshim hunk applies as is.References