add write tool formatters#1017
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bee016d to
852ae68
Compare
852ae68 to
f2399f0
Compare
af63b1e to
1522547
Compare
f2399f0 to
4166e5d
Compare
1522547 to
2162423
Compare
mathiusj
left a comment
There was a problem hiding this comment.
write formatter — one inconsistency with the sibling formatters.
| lines = content.to_s.lines | ||
| preview = truncate(lines.first.to_s.strip) | ||
| count = lines.length | ||
| "WRITE #{path} \"#{preview}\" (+#{count} #{"line".pluralize(count)})" |
There was a problem hiding this comment.
format_write has no bare-name fallback and interpolates path untruncated — unlike every sibling. format_bash/format_ls/format_read degrade to "BASH"/"LS"/"READ" when the key is absent and run path through truncate. This line renders unconditionally, so no-args produces WRITE "" (+0 lines) (double space, empty quotes), and a long path blows the one-line goal since it isn't truncated. Suggest guarding the bare case and wrapping path in truncate to match the others.
There was a problem hiding this comment.
Added the fallback for nil paths, but the path should not be truncated. Some tools truncate the command or other values, such as BASH and LS, but the path should remain fully present so that users can easily access the items that were modified. This mirrors the Claude side of tool formatters.
2162423 to
9774c62
Compare
4166e5d to
1d5f2cb
Compare
9774c62 to
eecfae1
Compare
0c38e90 to
5e31fef
Compare
eecfae1 to
daeaf21
Compare
5e31fef to
32856c2
Compare

Closes #1025