fix: restore live thinking streaming on 2.1.225/226; add answer streaming + verbose Read content - #9
Open
asgeirtj wants to merge 5 commits into
Conversation
…ture + message_stop shapes
…tent for Read results in verbose mode
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.
TL;DR
Live thinking streaming is broken in the current 2.1.225/2.1.226 releases — the
thinking-streamingreducer/event sub-fix silently stopped applying, so thinking blocks only render when they land instead of streaming as deltas arrive. This PR fixes that, adds a newanswer-streamingpatch, hardens the thinking request, and restores full verbose Read output.The regression (fafd40f)
2.1.225 changed the inner stream handler's options destructure by one character:
The comma tail made
missingStreamingThinkingHandlerPatternskip the entire reducer branch, while every render-side sub-fix still hit — sothinking-streamingreported 5 patched and looked healthy. The playbook's own warning ("patch count still looks nonzero but live thinking is broken") was the exact failure mode.message_stopalso gained a comma-if wrapper (if(dt?.finalize(),...,d)bnt?.resetAuthoringProgress();return) that needed a third needle.Fix: the destructure matcher accepts either tail, the injection needle drops the trailing separator, and the new
message_stopshape has its own needle. On 2.1.226 the module now reports 13 patched and the__cc_prevStreamingThinkingmarkers land inside the stream handler itself. Verified at runtime (tmux + timestamped pane captures): thinking text on screen 11s into a 31s turn, growing continuously.Debugging rule now in the playbook: verify the
__cc_markers inside the handler — module counts alone prove nothing.New:
answer-streaming(fa24cc7 + fd2d135)Upstream ships a complete live answer-text pipeline (text_delta → throttled store → bottom-of-transcript preview), but gates all of it on
sk = !prefersReducedMotion && !isWindowsTerminal(). WithprefersReducedMotion: true, answers only appear after the message lands.The patch enables just the two consumers answer streaming needs — the delta-apply callback and the preview-visible flag — leaving
skitself (and thedeferMessagesrender-coalescing it controls) untouched. An earlier iteration flipped the wholeskdefinition; don't do that — it disables the deferred-messages path and degrades live transcript rendering under load. The Windows Terminal guard is preserved.Hardening: thinking display request (fd2d135)
2.1.226 also split the request builder's env-flag read and put
displaybehindB1()&&Xkn(model)gates:The old display-defaulting sub-fix no longer matched. A new matcher rewrites this shape to
vr=di?cfg.display??"summarized":void 0. Without thedisplayfield the API streams no thinking text at all, so this is request-side insurance against those gates flipping.New:
read-verbose-content(7005bf5)Completes the
tool-call-verboseintent on current builds: upstream's verbose Read result renderer collapsed to "Read N lines" even withverbose:!0forced. The patch replaces the Read tool'srenderToolResultMessagegetter with a wrapper that renders the full line-numbered content (via the upstream{content,startLine}formatter, discovered by shape) when verbose, falling back to the original renderer otherwise. All helpers are discovered by shape per the matcher design rules.Validation
node patch-claude-display.ts --file content.js --dry-runon pristine 2.1.226: all modules at expected counts (thinking-streaming 13/13,answer-streaming 2/2,read-verbose-content 1/1)--versionshows(patched)