Skip to content

Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant)#7626

Merged
jh-block merged 12 commits intomainfrom
jhugo/trim-tool-details-and-ui-cleanup
Mar 17, 2026
Merged

Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant)#7626
jh-block merged 12 commits intomainfrom
jhugo/trim-tool-details-and-ui-cleanup

Conversation

@jh-block
Copy link
Copy Markdown
Collaborator

@jh-block jh-block commented Mar 3, 2026

  • Trim whitespace from tool parameter values and output text before rendering in code blocks in the expandable tool details
  • Simplify ToolCallArguments with a unified formatValue helper, render expanded values as <pre> instead of MarkdownContent
  • Simplify reasoning/thinking content display from collapsible <details> to inline italic text
  • Remove MessageContent::Reasoning variant — MessageContent::reasoning() now produces Thinking content, so the UI only ever sees thinking type
  • Old sessions with serialized reasoning content are migrated to thinking during deserialization
  • Remove ReasoningContent struct, as_reasoning(), and all Reasoning match arms across provider formats, agent, context management, CLI output, and OpenAPI schema
  • UI renamed getReasoningContentgetThinkingContent, only handles thinking content type

@jh-block jh-block requested a review from DOsinga March 3, 2026 19:38
@jh-block jh-block changed the title Trim tool parameters and output in expandable tool details, simplify reasoning display Trim tool parameters and output in expandable tool details, combine reasoning and thinking to just thinking Mar 3, 2026
@jh-block jh-block changed the title Trim tool parameters and output in expandable tool details, combine reasoning and thinking to just thinking Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) Mar 4, 2026
Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels like it might break things but it also is strictly better. so let's get it in

@jh-block jh-block force-pushed the jhugo/trim-tool-details-and-ui-cleanup branch 3 times, most recently from 8db09a9 to 485ca97 Compare March 13, 2026 15:54
jh-block and others added 11 commits March 17, 2026 11:52
Change MessageContent::reasoning() to produce Thinking instead of
Reasoning, so the Reasoning variant never enters conversations.
The OpenAI format's format_messages now also maps Thinking content
back to reasoning_content for the API.

On the UI side, rename getReasoningContent to getThinkingContent
and only handle the 'thinking' content type since 'reasoning' will
no longer appear in messages from the server.
The Reasoning variant is no longer needed since reasoning() now produces
Thinking content. Old sessions with serialized Reasoning content are
handled by the custom deserializer which maps 'reasoning' type to
'thinking' during deserialization.

Removes ReasoningContent struct, Reasoning enum variant, as_reasoning(),
and all Reasoning match arms across provider formats, agent, context
management, CLI output, and OpenAPI schema.
All call sites now use MessageContent::thinking(text, "") and
as_thinking() directly, completing the Reasoning→Thinking unification.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…back

- Add thinking/redacted_thinking support to Anthropic streaming handler:
  thinking deltas are streamed incrementally for real-time UI display,
  with the complete block (including signature) yielded at content_block_stop
- UI pushMessage merges thinking chunks in-place, replacing with the final
  signed block when it arrives
- Drop test_parse_thinking_response test per review feedback
- Remove redundant Array.isArray branch in ToolCallArguments

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@jh-block jh-block force-pushed the jhugo/trim-tool-details-and-ui-cleanup branch from 905e463 to c033cc9 Compare March 17, 2026 11:53
@jh-block jh-block added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit a762fe1 Mar 17, 2026
21 of 22 checks passed
@jh-block jh-block deleted the jhugo/trim-tool-details-and-ui-cleanup branch March 17, 2026 14:20
jh-block added a commit that referenced this pull request Mar 17, 2026
…ct-ui

* origin/main:
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (#7626)
  don't imply running builds all the time in AGENTS.md (#7865)
  fix: unregister goosed child process's  listener (#7956)

# Conflicts:
#	ui/desktop/src/api/index.ts
rabi added a commit to rabi/goose that referenced this pull request Mar 18, 2026
The thinking delta handling was proposed in this PR initially,
but block#7626 merged first. This adds certain optimizations proposed
earlier in this PR.

As thinking_delta is yielded and stored individually, then the
complete block re-emitted at content_block_stop — N+1 entries per
thinking block end up in both database and session memory.

Streaming partial thinking deltas serves no purpose: without a
signature they cannot be sent back to the API (format_messages
drops them), and the UI renders thinking as a complete block
rather than incrementally.

Emit once at content_block_stop. Replace JSON delta comparisons
with typed ContentDelta enum. Add streaming tests.

Change-Id: Id42262e30f1eea8d24f1ddb87381395714a91821
Signed-off-by: Rabi Mishra <[email protected]>
rabi added a commit to rabi/goose that referenced this pull request Mar 18, 2026
The thinking delta handling was proposed in this PR initially,
but block#7626 merged first. This adds certain optimizations proposed
earlier in this PR.

As thinking_delta is yielded and stored individually, then the
complete block re-emitted at content_block_stop — N+1 entries per
thinking block end up in both database and session memory.

Streaming partial thinking deltas serves no purpose: without a
signature they cannot be sent back to the API (format_messages
drops them), and the UI renders thinking as a complete block
rather than incrementally.

Emit once at content_block_stop. Replace JSON delta comparisons
with typed ContentDelta enum. Add streaming tests.

Change-Id: Id42262e30f1eea8d24f1ddb87381395714a91821
Signed-off-by: Rabi Mishra <[email protected]>
jh-block added a commit to rabi/goose that referenced this pull request Mar 18, 2026
* main: (32 commits)
  Revert message flush & test (block#7966)
  docs: add Remote Access section with Telegram Gateway documentation (block#7955)
  fix: update webmcp blog post metadata image URL (block#7967)
  fix: clean up OAuth token cache on provider deletion (block#7908)
  fix: hard-coded tool call id in code mode callback (block#7939)
  Fix SSE parsers to accept optional space after data: prefix (block#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (block#7961)
  Add WebMCP for Beginners blog post (block#7957)
  Fix download manager (block#7933)
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (block#7626)
  don't imply running builds all the time in AGENTS.md (block#7865)
  fix: unregister goosed child process's  listener (block#7956)
  feat: adversarial agent for preventing leaking of info and more  (block#7948)
  Update contributing.md (block#7927)
  docs: add credit balance monitoring section (block#7952)
  docs: add Cerebras provider to supported providers list (block#7953)
  docs: add TUI client documentation to ACP clients guide (block#7950)
  fix: removed double dash in pnpm command (block#7951)
  docs: polish ACP docs (block#7946)
  claude adaptive thinking (block#7944)
  ...
lifeizhou-ap added a commit that referenced this pull request Mar 20, 2026
* main: (22 commits)
  feat: add gemini-acp provider, update docs on subscription models + improvements to codex (#8000)
  fix(openai): use Responses API for gpt-5.4 (#7982)
  Remove lead/worker provider (#7989)
  chore(release): release version 1.28.0 (#7991)
  Fix empty tool results from resource content (e.g. auto visualiser) (#7866)
  Separate SSE streaming from POST work submission (#7834)
  fix: include token usage in Databricks streaming responses (#7959)
  Optimize tool summarization (#7938)
  fix: overwrite the deprecated googledrive extension config (#7974)
  refactor: remove unnecessary Arc<Mutex> from tool execution pipeline (#7979)
  Revert message flush & test (#7966)
  docs: add Remote Access section with Telegram Gateway documentation (#7955)
  fix: update webmcp blog post metadata image URL (#7967)
  fix: clean up OAuth token cache on provider deletion (#7908)
  fix: hard-coded tool call id in code mode callback (#7939)
  Fix SSE parsers to accept optional space after data: prefix (#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (#7961)
  Add WebMCP for Beginners blog post (#7957)
  Fix download manager (#7933)
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (#7626)
  ...
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…and Thinking as the same thing (sorry Kant) (block#7626)

Co-authored-by: Claude Opus 4.6 <[email protected]>
Signed-off-by: esnyder <[email protected]>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…and Thinking as the same thing (sorry Kant) (block#7626)

Co-authored-by: Claude Opus 4.6 <[email protected]>
Signed-off-by: esnyder <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants