Skip to content

feat(tools): collapse tool output to single-line header with status colouring#245

Merged
LeeCheneler merged 2 commits intomainfrom
feat/244-tool-output-single-line-header
Mar 30, 2026
Merged

feat(tools): collapse tool output to single-line header with status colouring#245
LeeCheneler merged 2 commits intomainfrom
feat/244-tool-output-single-line-header

Conversation

@LeeCheneler
Copy link
Copy Markdown
Owner

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 ToolResult type with an explicit status field ("ok" | "error" | "denied") replacing plain string returns from all tool execute functions. Three helpers — ok(), err(), denied() — construct results consistently across tools.

ToolMessage is simplified to render only the first line (the pre-formatted header). The header formatting in formatToolHeader now uses the status to pick the chalk colour. withFilePermission and all 10 built-in tools are updated to return ToolResult.

Notes for Reviewers

This is a breaking change to the internal Tool interface — any out-of-tree tool implementations would need to return ToolResult instead of a plain string. MCP tools are unaffected as their results are wrapped at the boundary in tool-execution.ts.

…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
@LeeCheneler LeeCheneler merged commit 9d991e6 into main Mar 30, 2026
4 checks passed
@LeeCheneler LeeCheneler deleted the feat/244-tool-output-single-line-header branch March 30, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: collapse tool output to single-line header in chat

1 participant