jackwener/maka-agent

bug(desktop): collapsed tool rows show no invocation target — ordinary tool cards read empty

开放

#3,336 创建于 2026年8月20日

 (3 条评论) (0 个反应) (0 位负责人)TypeScript (0 个派生)github user discovery
bughelp wanted

仓库指标

星标
 (1 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Symptom (Current)

In the Desktop transcript, every collapsed tool row — and the collapsed group header — renders only the tool name (plus duration once settled). Nothing says what the call is doing, so the row reads as an empty placeholder. Most visible for Bash, Read, ScheduledTask, and the task_* ledger tools.

Concretely a collapsed row shows ● Bash where it should show ● Bash $ git status --porcelain; a collapsed group header shows ● Bash 🔧 3 ▾ where it should show ● Bash <last command> 🔧 3 ▾.

Root cause (verified on main @ 9d4392c8)

  • packages/ui/src/tool-activity.tsx:347standardToolCall() sets the collapsed-row target as target: item.intent ? formatToolIntent(item.intent) : undefined.
  • packages/runtime/src/tool-runtime.ts:3072describeToolIntent() only produces an intent for ExploreAgent (只读探索:…). Every other tool has item.intent === undefined, so target is undefined and the row shows name only.
  • Linked subagent rows have a result.summary fallback (tool-activity.tsx:372–389); ordinary tool rows have none.
  • The shared invocation formatter formatToolInvocationLine() in packages/core/src/tool-quiet-preview.ts already derives a one-line "what" from args (command / path / pattern / title / url …), but Desktop consumes it only inside the expanded detail panel (ToolCallDetail), never on the collapsed row.
  • The intent-only target line predates #1254 and survived the Astryx migration (#1728), so every released Desktop build is affected; this is code-determined, not environment-specific.

Scope — the collapsed-row what slot (Desktop)

This issue is specifically the collapsed-row target (what the call does), which Astryx ChatToolCalls.CallRow renders between the name and the stats — but Maka only ever fills it from item.intent, which is empty for almost every tool. Both the single-call row and the group header use the same call.target, so one fallback chain fixes both.

It is not about:

  • the expanded detail panel (already has the invocation line + full output via ToolCallDetail / formatToolInvocationLine), or
  • the compact-row outcome / (no output) annotation — that is a TUI/CLI concern (packages/cli/src/pi-transcript-tools.ts), tracked separately in #3338.

Proposed fix (Planned)

P0 — collapsed-row target fallback chain (UI only, no protocol change):

target = item.intent ?? firstLine(formatToolInvocationLine({ toolName, args }, locale), cap ≈120)
  • Available from tool_start (args stream live), so a running row says what it is doing immediately; historical sessions work too because args are persisted.
  • Reuses the existing redaction path in formatToolInvocationLine (redactSecrets + sensitive-key masking); no new secret surface.
  • Tools with no args hint keep today's behavior (no regression).

P1 — per-tool coverage audit: task_create/task_update (first subject + count), GoalSet (condition), AskUserQuestion (question count), in-flight agent_swarm objective fallback; MCP tools without structured args stay as-is.

Acceptance

  • Any tool with structured args shows one line of "what it is doing" in the collapsed row and the collapsed group header, while running.
  • Secret-bearing args/commands stay redacted (extend tool-args-redaction-contract.test.ts).
  • Expanded detail panel unchanged; existing resultHeadline !== invocationLine dedupe preserved.

贡献者指南