feat(renderer): collapse compact tool call+result into a single line#269
feat(renderer): collapse compact tool call+result into a single line#269zjshen14 wants to merge 1 commit into
Conversation
Compact tools (read, glob, grep, ls, todo) were showing two terminal lines per tool call — one ○ call line at dispatch time and a separate ✓ result line — instead of the single combined line described in the issue: `✓ read src/foo.ts (42 lines)`. Fix: defer display of compact tools to result time and emit one line that includes both the file path / pattern from the call args and the result count. `summariseResult` gains an optional `args` parameter so the path/pattern is inserted between the tool name and the count. `printCompactToolRow(name, args, result)` encapsulates the combined line. Runner queues call args per compact tool and passes them to `printCompactToolRow` at result time (same ordering contract as the existing `pendingEdits` queue for edit diffs). `think` is unchanged — it already achieves single-line behavior (call prints "◦ thinking…", result is silent). Closes #89 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Reviewed at 1. FIFO queue correctness depends on
Today that holds because 2. Error detection via
Minor nit: the existing runner check at 3.
4.
Test coverage is thorough — the six Verdict: Approve with the above as suggestions (none are blockers). The FIFO invariant observation (#1) is the most worth acting on before this grows, even if only as a comment. Generated by Claude Code |
Summary
read,glob,grep,ls,todo_write,todo_read) were showing two terminal lines per tool call — an○ callline at dispatch time and a separate✓ resultline — instead of the single combined line described in feat: Phase A6 — inline diffs + compact tool rows in renderer #89 (e.g.✓ read src/foo.ts (42 lines)).thinkis unchanged — it already achieves single-line behavior (◦ thinking…at call time, silent at result time).Changes
src/cli/renderer.ts:summariseResultgains an optionalargsparameter so the path/pattern is inserted between the tool name and the count. NewprintCompactToolRow(name, args, result)encapsulates the combined line.src/cli/runner.ts: AddspendingCompactArgsqueue (same ordering contract as the existingpendingEditsqueue for edit diffs) to thread call-time args through to result-time display. Attool_calltime, args are queued silently; attool_resulttime,printCompactToolRowemits the combined line.src/cli/renderer.test.ts: 9 new tests coveringsummariseResultwith args andprintCompactToolRow.Test plan
npm run typecheck && npm run lint && npm run format:check && npm test— all pass (742 tests)✓ read src/foo.ts (42 lines)style line✓)thinktool behavior unchangedCloses #89
🤖 Generated with Claude Code
Generated by Claude Code