feat(tools): collapse tool output to single-line header with status colouring#245
Merged
LeeCheneler merged 2 commits intomainfrom Mar 30, 2026
Merged
Conversation
…olouring
Tool messages now display only the header line (name + params) in the chat.
Full output is still available via Tab. Tool headers are coloured by status:
yellow for success, red for error, dim for denied.
Introduces ToolResult type with explicit status field ("ok" | "error" |
"denied") replacing plain string returns from tool execute functions.
Closes #244
Remove the redundant CommandResult interface and have commands return ToolResult via ok()/err()/denied() helpers, matching the tool convention. Also fix inconsistent Error: prefixes in err() messages, use helpers in MCP paths, and correct denyMessage status in permission tests. Refs #244
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.
Summary
Tool messages now display only the header line (name + params) in the chat instead of 5 trailing body lines. Full output remains available via Tab. Tool headers are coloured by execution status: yellow for success, red for error, dim for denied.
GitHub Issue
Closes #244
What Changed
Introduces a
ToolResulttype with an explicitstatusfield ("ok" | "error" | "denied") replacing plain string returns from all toolexecutefunctions. Three helpers —ok(),err(),denied()— construct results consistently across tools.ToolMessageis simplified to render only the first line (the pre-formatted header). The header formatting informatToolHeadernow uses the status to pick the chalk colour.withFilePermissionand all 10 built-in tools are updated to returnToolResult.Notes for Reviewers
This is a breaking change to the internal
Toolinterface — any out-of-tree tool implementations would need to returnToolResultinstead of a plain string. MCP tools are unaffected as their results are wrapped at the boundary intool-execution.ts.