Skip to content

fix(runtime-host,ui,cli): name live tool calls on compact and collapsed rows - #3376

Open
me2seeks wants to merge 1 commit into
apache:mainfrom
me2seeks:fix/tool-compact-row-target
Open

fix(runtime-host,ui,cli): name live tool calls on compact and collapsed rows#3376
me2seeks wants to merge 1 commit into
apache:mainfrom
me2seeks:fix/tool-compact-row-target

Conversation

@me2seeks

Copy link
Copy Markdown
Contributor

Closes #3336. Closes #3338.

Problem

Collapsed tool rows on Desktop and compact rows on the TUI rendered name-only● Bash, ● Task Create — with no hint of what the call does. Two distinct causes, one shared root:

  1. Shared root (live window): Runtime Host live tool_start frames omit args entirely (lean-channel decision from feat(cli): add Runtime Host-backed TUI sessions #2308), and durable args arrive only with the turn-end transcript reconcile. So during the one window a user actually watches, neither surface can name the call.
  2. Desktop-specific: even after args arrived (and on history replay), the collapsed row/group-header target read only item.intent, which describeToolIntent produces solely for ExploreAgent — every other tool rendered ● Name forever.

What changes

Layer Change
@maka/core formatToolInvocationLine gains per-tool lines for task_create (first subject + count), task_update (subject / id → status), GoalSet (condition), AskUserQuestion (first question + count). New projectToolArgsPreview(toolName, args) builds a bounded, redacted, whitelist-shaped args subset for the live wire (never file bodies or option payloads; sensitive keys dropped structurally; every string through redactSecrets; per-string 240 chars, whole preview 2 KB).
runtime-host wire Live tool_start frames carry optional intent (pass-through, 512 B) and argsPreview (≤8 KB). The strict decoder accepts and bounds both. RUNTIME_HOST_COMPATIBILITY_EPOCH bumped 29 → 30: older clients reject unknown keys on this event and would tear the connection down.
Desktop (@maka/ui) Collapsed row + collapsed group header target: intent ?? firstLine(formatToolInvocationLine(args ?? argsPreview)), hard-capped at 120 chars. Works live (preview), after settle (full args), and on history replay (persisted args) — history needs no wire change.
TUI (packages/cli) Compact rows consume argsPreview while live (turn-end reconcile still replaces it with durable full args). The dim (no output) placeholder now appears only when the row cannot name the call● Bash $ git add -A no longer carries the disclaimer. Empty args objects no longer render as input: {} noise.

formatToolInvocationLine stays client-side, so each surface formats in its own locale; the host ships data, not text.

Verification

  • @maka/core 585/585 — incl. new invocation-line cases (task/goal/question/ScheduledTask) and projectToolArgsPreview (whitelist shape, secret redaction, sensitive-key drop, bounds, count fidelity via tasksTotal, WriteStdin inputPreview shape).
  • @maka/runtime-host 1038/1038 — incl. live tool_start projection (intent + bounded preview, never full args), strict-decoder accept/reject cases, client projector pass-through.
  • @maka/ui 189/189 — incl. collapsed-target suite: args-derived line, intent precedence, live argsPreview, task subject, 120-char cap, redaction.
  • packages/cli 339/339 — incl. live quiet-Bash row from the preview, task_create subject row, no output kept only for un-nameable rows.
  • Desktop main-process suite green, incl. extended tool-args-redaction-contract (secrets in command strings never reach the collapsed row or the wire preview).
  • npm run typecheck (all workspaces), biome lint/format, and knip (desktop, ui) clean.

Notes / follow-ups

…ed rows

Collapsed tool rows (Desktop) and compact rows (TUI) rendered name-only
for the whole live window: Runtime Host live tool_start frames omit args
entirely, and durable args arrive only with the turn-end transcript
reconcile. Desktop rows stayed empty even after that, because the
collapsed target only consumed the ExploreAgent-only intent field.

- core: formatToolInvocationLine learns task_create/task_update/GoalSet/
  AskUserQuestion lines; new projectToolArgsPreview builds a bounded,
  redacted, whitelist-shaped args subset for the wire.
- runtime-host: live tool_start frames carry intent (pass-through) and
  argsPreview; strict decoder accepts and bounds both; compatibility
  epoch 30 (older clients reject unknown keys).
- ui: collapsed row and group header fall back to the invocation line
  (args ?? argsPreview), first line, hard-capped at 120 chars.
- cli: compact rows consume argsPreview live; the 'no output'
  placeholder now only appears when the row cannot name the call; empty
  args objects no longer render as 'input: {}' noise.

Closes apache#3336, closes apache#3338.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant