Chore/trim tool result format#43
Merged
Merged
Conversation
Remove redundant 'Use these results to continue helping the user.' suffix and 'Tool Result' label from tool result messages. The role:tool already signals the context to the model, and the tool name header alone is sufficient. Saves ~15 tokens per tool call.
- Remove 'Tool results:' prefix from tool messages - run: Remove 'stdout:'/'stderr:' labels, simplify status line to '(exit N in Xs)' format, consistent for success and failure - read: Remove path prefix (already in tool call args), keep line count - edit: Simplify success message to 'Edited X (N chars replaced).' - write: Simplify success message to 'Wrote N bytes to X.' - ls: Append '/' to directory entries for file/dir distinction - grep: Add match count and file count summary at top of output
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes and shortens the human-readable formatting of tool outputs across tinyharness-lib tools and the agent tool-result plumbing, aiming to reduce verbosity and make results easier to scan.
Changes:
- Simplifies
read,write,edit, andruntool output strings to be more compact. - Enhances
lsoutput by appending/to directory names. - Adds a
grepsummary header ({matches} matches in {files} files) and trims truncation wording; removes extra “Tool results:” wrapper text in the agent layer.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tinyharness-lib/src/tools/write.rs | Shortens the write success message format. |
| tinyharness-lib/src/tools/run.rs | Trims run tool description and simplifies stdout/stderr/exit formatting. |
| tinyharness-lib/src/tools/read.rs | Removes path prefixing and shortens full/partial read result headers. |
| tinyharness-lib/src/tools/ls.rs | Appends / to directory entries in listings. |
| tinyharness-lib/src/tools/grep.rs | Adds a summary header and shortens truncation messaging. |
| tinyharness-lib/src/tools/edit.rs | Shortens the edit success message format. |
| src/agent/tui_loop.rs | Removes “Tool Result” suffix in the tool result markdown header. |
| src/agent/tools.rs | Removes “Tool Result” suffix in the tool result markdown header (non-TUI path). |
| src/agent/tool_result.rs | Sends tool results without the extra wrapper text in Role::Tool messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.