Send display: summarized so Claude thinking renders - #4355
Open
ThePharmer wants to merge 1 commit into
Open
Conversation
The Agent SDK request never set thinking.display, so on Opus 4.7 and later the API default of "omitted" applied and every thinking block arrived with empty text. Paseo drops empty blocks, so Claude agents never produced reasoning timeline items. Closes getpaseo#4342
Contributor
|
| Filename | Overview |
|---|---|
| packages/server/src/server/agent/providers/claude/agent.ts | Adds the supported summarized display mode to both adaptive-thinking configurations without changing disabled or provider-default behavior. |
| packages/server/src/server/agent/providers/claude/agent.test.ts | Updates focused assertions to verify that adaptive-thinking requests include the summarized display mode. |
Reviews (1): Last reviewed commit: "Send display: summarized so Claude think..." | Re-trigger Greptile
11 tasks
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.
Linked issue
Closes #4342
Type of change
Reasoning
Claude Code agents never show a Thought row in the Paseo timeline, on any Claude 4.7+ model at any effort level. The daemon builds
thinking: { type: "adaptive" }for the Agent SDK but never setsdisplay, so the request falls through to the API default, which is"omitted"on Opus 4.7 and later. Every thinking block then arrives with empty text and a populated signature, and Paseo's extractor drops empty blocks by design. The result is zeroreasoningtimeline items for Claude, while Codex on the same daemon renders reasoning fine.This PR sets
display: "summarized"at bothresolveThinkingConfig()call sites that enable adaptive thinking. Paseo's only reason to read thinking blocks is to show them to the user, which is exactly the case the Anthropic docs saysummarizedis for. With the change, Claude agents stream a Thought row during the turn, and Settings > Always expand reasoning has something to act on.The bundled SDK (
@anthropic-ai/claude-agent-sdk0.3.246) already types the field onThinkingAdaptive, so no dependency change is needed.Goals
reasoningtimeline items appear for Claude agents, in the web UI and inpaseo logs --filter text.displayfield.Non-goals
{"type":"system","subtype":"thinking_tokens"}message. That is mentioned as optional in the issue and is a separate change.thinking: { type: "disabled" }or the provider-default path, which continue to send nothinkingat all.summarized, first answer text arrives a couple of seconds later on average because the server streams the summary first. Total turn time is unchanged, and the user sees the Thought row streaming during that gap instead of a blank wait. Measurements are in the issue.QA
Reproduced before the fix (Paseo 0.7.2, Claude Code 2.1.258, model
claude-opus-5, efforthigh, Debian 12 in Docker): a Claude agent turn shows tool calls and assistant text but no Thought row.paseo logs <agent-id> --filter textlists only[User]and assistant text, no[Thought]entries. The rawstream-jsonoutput from the CLI under the same options carriesthinkingblocks with"thinking":""and a populatedsignature, whileusage.output_tokens_details.thinking_tokensis non-zero. Full captures, the CLI A/B with--thinking-display summarized, and timing measurements are in #4342.Confirmed after the fix on the same setup: a child image patching the two call sites in the published dist to
{ type: "adaptive", display: "summarized" }produces[Thought]rows inpaseo logs --filter textand renders the collapsed Thought row in the web UI. That patch has been running for me from 0.2.1 through 0.7.2.Unit tests (
packages/server/src/server/agent/providers/claude/agent.test.ts): the Ultracode assertion and the "reconciles Off when switching to an unsupported model" case now assert{ type: "adaptive", display: "summarized" }. ThetoEqualcase fails onmainwithout the source change and passes with it. Test, typecheck, lint, and format results are from the full CI run on my fork before opening this PR: https://github.com/ThePharmer/paseo/actions/runs/33943978065 (22 checks green).Platforms tested: web UI in a browser, Android, and
paseo logsCLI, against a Linux (Docker) daemon. Not tested: iOS and Electron desktop. The change is daemon-side only, so those surfaces receive the same timeline items.Checklist
npm run typecheckpassesnpm run lintpassesnpm run formatpasses