jackwener/maka-agent

bug(cli): compact tool rows read empty for quiet or nested-args tools — no 'what' without expanding

オープン

#3,338 opened on 2026/08/20

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (0 件のフォーク)github user discovery
bughelp wanted

Repository metrics

Stars
 (1 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Symptom (Current)

In the TUI/CLI transcript, the compact tool row reads ● Bash (no output) for any quiet Bash call — a successful mkdir, git add, cd, export, etc. The annotation slot carries only the result (no output / N lines / exit code), and for quiet commands there is no result text, so the whole row collapses to name + no output.

Because the compact row's input summary (toolInputSummary) is suppressed or truncated, the user cannot see what ran without expanding. Expanding (Ctrl+O) then dumps the full output card — the opposite extreme, "too much". The result: quiet commands are invisible, and there is no middle ground between "empty" and "firehose".

The task_* ledger tools (task_create, task_update, …) have the same shape: their args/result are nested JSON, so the row shows the tool name with no legible subject or count.

Root cause (verified on main @ 9d4392c8)

  • packages/cli/src/pi-transcript-tools.ts renderCompactToolBlock() lays out ● Name target (annotation) where target = toolInputSummary(entry).
  • toolInputSummary() (same file, ~line 715) has explicit per-tool cases for Bash/Read/Write/Edit/Grep/Glob/WriteStdin/maka_computer plus a formatToolInvocationLine generic fallback. For Bash it returns $ <command>.
  • compactAnnotation() builds the (...) part from the result only: compactToolSummary() returns noOutput() (dim no output) when a successful shell_run/terminal result has zero output lines. The command the row should be named by is present in input, but when the input summary is empty/long and the annotation is no output, the visible row degenerates to ● Bash (no output).
  • task_* tools have no per-tool case, so they fall to the generic formatToolInvocationLine fallback, which flattens nested tasks: [...] into a multi-line kv dump that collapseToSingleLine cannot turn into a legible subject.

So the gap is not "no data" — the command is in input — but the compact row does not reliably surface the what for quiet or nested-args tools, and the only escape is the full expanded card.

Scope — TUI/CLI compact-row what + outcome signal

This issue is the TUI/CLI counterpart to the Desktop collapsed-row gap in #3336. Both are "the compact/collapsed row doesn't say what the call did", but they live in different surfaces and formatters:

  • Desktop: packages/ui/src/tool-activity.tsx + formatToolInvocationLine → collapsed row / group header (#3336).
  • TUI/CLI: packages/cli/src/pi-transcript-tools.ts renderCompactToolBlock / toolInputSummary / compactAnnotation → compact row (this issue).

Proposed fix (Planned)

P0 — make the compact row always name the what, independent of output:

  • Ensure toolInputSummary's per-tool Bash case (and the generic fallback) always contributes the command/subject to the row even when the annotation is no output — i.e. a quiet Bash reads ● Bash $ git add -A (no output), never ● Bash (no output).
  • Add task_* per-tool cases to toolInputSummary so task_create shows the first subject (+ count) instead of a JSON dump.

P1 — middle ground between compact and full-expand: consider a single-line result preview (first output line / headline) on the compact row or as a low-cost toggle, so "what happened" is reachable without Ctrl+O firehose.

Acceptance

  • A quiet Bash (no stdout) compact row shows the command; the no output annotation is secondary, never the only content.
  • task_create/task_update compact rows show a legible subject/count, not a JSON dump.
  • Expanding still reveals the full card; truncation protects fixed-shape annotations (existing protect contract preserved).

コントリビューターガイド