fix(chat): collapse tool result by default (consistent with reasoning)#75
Merged
Merged
Conversation
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.
Symptom
Inconsistency in how
renderChatMessage(insrc/js/chat/core.js) displays auxiliary content:msg.reasoning<details>with a summaryrole === 'tool'content<div>Tool results often span hundreds of lines (file listings, JSON blobs, shell output), so the chat scroll becomes dominated by raw tool output rather than the conversation. Reasoning sections behave correctly — click summary to expand. Tool results should match that pattern.
Fix
Wrap the
role === 'tool'branch in a<details>with the same summary pattern used by reasoning. Summary shows a compact label so users can identify the tool at a glance:msg.tool_namepresent:⚡ <tool_name> — <first line preview>…⚡ Tool Result — <first line preview>…Body is the same content that used to render directly, now collapsed inside the
<details>.Test plan
Verified
Tested on top of
main(204e0e5, v3.6.0). UX matches reasoning panel — chat is much more readable in sessions heavy on tool use.