[Enhancement] Tool output line cap and /expand follow-ups (#1298 #945)
Description
The changes in #1298 by @addyCooks was created before my #945, without him knowing bashoutput can be shown with agent calling execute_bash. The /expand definitely changed a bit on how I would implement.
Also upon testing, I have found out some inconvinience I am facing, several vars being used to similar purposes, and in general ctrl+o should be renamed as its name is duplicate with what we have on /expand now. So I decided to open this issue for improvement.
-
No opt-out for the cap. A preference (like #945's
showAgentBashOutput) or a toggle to show tool cards uncapped would help read a wholewrite_file/string_replace/diff_editat a glance. Today the only route to full output is/expand <n>per result, which is slow when reviewing edits. Enhancement, not a defect: the capped default should stay. -
/expand <n>is a silent no-op forsearch_file_contents. Its formatter hand-rolls a 20-line slice and never readsToolOutputContext, so expanding reprints the same capped card while reporting success. (The cap came from #1311, not #1298.) -
Agent bash cards never show their
/expand n. The id is recorded and/expand nworks, but the card is queued with no context provider, soBashProgresshas noexpandIdand prints no hint. You must run bare/expandand guess the row. -
Bare
/expandtruncates silently: it keeps 50 results but lists the last 20 with no indication. -
/clearcallsclearExpandableToolResults, which empties the array but notnextExpandId, so ids keep climbing for the life of the process. -
Three cap notes, two directions, three wordings:
CappedLines(first 20,+N more lines - /expand n),BashProgress(last 20,+N earlier lines, no hint),search_file_contents(first 20, no hint). Tail direction is right for bash, since errors are at the end. -
The toggle is named for states that no longer match. "Expand Tool Results by default" and Ctrl+O's
expand tool resultshint describe the OFF state as full output, but OFF is now a 20-line card. Before #1298 both names were accurate (ON = one-line summary, OFF = full output); the cap made "expand" untrue while "compact" stayed correct. Rename to a summary-vs-card vocabulary: settingSummarize tool results: ON/OFF, hintctrl-o show tool cards/ctrl-o summarize tool results, tips and docs "Toggle tool result summaries (Ctrl+O)". -
showAgentBashOutputgives bash a second escape from the compact summary, separate from the hardcodedALWAYS_EXPANDED_TOOLSset (write_tasks,ask_user). Bash was never in that set - a spec asserts it - and before #945 its completed card folded into the tally like any other tool; We should still hide it within compact=ON. The implementation in #945 changed the behavior a bit too much.
Use Case
See above
Proposed Solution
See above
Alternatives Considered
See above
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] This feature aligns with the project's goals (local-first AI assistance)
Implementation Notes (optional)
If you have thoughts on how this could be implemented, share them here
Hi @akramcodez please assign me this as I will have a PR out soon.
I was not aware of @addyCooks 's PR beforehand, and the design should be much cleaner.
Thanks.
Thanks for the thorough write-up, @coralsundy! Happy for you to take this. I hadn't realised agent bash output could be shown via #945 when I built #1298, so unifying the cap notes and the bash path makes sense.
Points 1–4 touch code from #1298, so feel free to tag me on the PR Agreed on the summary-vs-card naming too: "expand" stopped being accurate once the cap landed.
sure @coralsundy 👍