Skip to content

[Task] feat: agentic trow summary for tool calls #596

@Astro-Han

Description

@Astro-Han

Use this for maintainer or agent execution work that is not a user-facing bug report or feature request.

Keep the issue concrete enough that an agent can understand the target, scope, and verification path.

Goal

Make trow summaries describe what the agent actually did instead of only rendering rigid command-count copy.

When this task is done, collapsed tool rows should be able to show verb-form summaries such as:

  • complete state: Created 1 file, edited 1 file, explored 2 files
  • in-progress state: Searching files in articles folder

The visual contract of the trow stays unchanged. Only the summary wording and its reducer/helper logic become more descriptive.

Scope

In scope:

  • Add a new helper, session-turn-trow-summary.ts, that turns ToolPart[] into structured summary pieces.
  • Map strong-semantic tools to verb-form summaries.
  • Support separate in-progress and complete-state summary copy.
  • Keep error summaries additive, for example ... , 1 failed.
  • Add reducer-style tests and zh/en coverage.

Out of scope:

  • Re-architecting the tool render pipeline.
  • Introducing a Tool Display Spec Registry.
  • Changing trow chrome, border, spacing, chevron, or typography defined by the current visual contract.

Relevant files or context

Background:

  • Current trow summary renders rigid copy like 已运行 N 条命令 / Ran N commands.
  • For agent-driven workflows such as file edits, file exploration, web search, and command execution, users want summaries that surface the action semantics.
  • This was discussed during slice 11b.1 review and intentionally deferred from PR refactor(session): rewrite session view per W1 visual lock for slice 11b.1 #589 as polish / UX follow-up work.

Proposed design (GPT-X recommendation):

  • Data layer:
    • new helper session-turn-trow-summary.ts
    • input: ToolPart[]
    • output: structured summary pieces (verb + count + object)
    • pieces consumed by the i18n renderer
  • Verb mapping:
    • read / list / glob / grep -> explored / read / searched
    • websearch -> searched web
    • bash -> ran command, with no stdout parsing to infer file changes
    • edit / write / apply_patch -> Created / Edited / Deleted only when metadata proves create/edit/delete; otherwise use Wrote / Changed
  • State transitions:
    • if any tool is running or pending, show the last running tool's current action
    • when all tools are terminal, switch to aggregate summary copy
    • if an error exists, append 1 failed without changing the color system
    • no fade transition; direct copy swap only
  • i18n:
    • zh uses concise Chinese without plural logic
    • en uses plural-aware keys

References:

Verification

  • Reducer-style unit tests cover common tool sequences and mixed states.
  • Unknown tools fall back to a safe generic summary such as Ran N tool calls.
  • bash stdout is never parsed to infer file changes.
  • zh/en parity is covered by tests.
  • Existing visual contract from DESIGN.md L412-L417 remains unchanged.

Execution mode

Agent should investigate and propose a plan first

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priorityappApplication behavior and product flowsenhancementNew feature or requesttaskMaintainer or agent execution taskuiDesign system and user interface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions