Skip to content

Chore/trim tool result format#43

Merged
PTFOPlayer merged 4 commits into
masterfrom
chore/trim-tool-result-format
Jun 30, 2026
Merged

Chore/trim tool result format#43
PTFOPlayer merged 4 commits into
masterfrom
chore/trim-tool-result-format

Conversation

@PTFOPlayer

Copy link
Copy Markdown
Owner

No description provided.

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
Copilot AI review requested due to automatic review settings June 30, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, and run tool output strings to be more compact.
  • Enhances ls output by appending / to directory names.
  • Adds a grep summary 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.

Comment thread tinyharness-lib/src/tools/grep.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread tinyharness-lib/src/tools/grep.rs
Comment thread tinyharness-lib/src/tools/run.rs
Comment thread tinyharness-lib/src/tools/run.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@PTFOPlayer PTFOPlayer merged commit e8e2ad6 into master Jun 30, 2026
10 checks passed
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.

2 participants