Skip to content

Coordinate shared high-fidelity tool-call presentation across mecatui #2123

Open

Description

@jbeda

Goal

Make tool-call information readable and consistent across conversation cards, compact summary lines, /toolcalls list/detail, the f6 delegation inspector, and permission-approval views. These surfaces currently format different slices of a call independently: Edit/Write arguments become colored diffs in active cards but generic fields in /toolcalls; approval has a separate raw/pretty argument view; child activity has only bounded trace previews. Improve fidelity without pretending these views have the same data or the same interaction budget.

This is an umbrella for reviewed slices, not a request to make every surface display an identical card or to rewrite the entire TUI at once.

Work to coordinate

  1. Inventory each surface's input, authoritative source, lifetime/reload behavior, and presentation: tool name and intent, received arguments, pending/provisional/canonical result and error, typed result blocks, approvals, and delegated activity. Identify genuine shared formatting decisions versus surface-specific geometry, focus, selection, and scrolling.
  2. Define a small shared client-local presentation boundary for the cases that actually recur. Consider an internal package (or the existing cmd/mecatui/internal/renderfmt) only if it simplifies at least two real consumers without creating a dependency cycle or leaking UI state. Reuse one safe semantic interpretation of a call; adapt it separately to a one-line row, a detailed inspector, or an approval view. Do not cache or replace the canonical received payload.
  3. Sequence specific improvements: argument-derived Edit diffs in /toolcalls (Restore Edit argument diffs in /toolcalls detail #2122), typed/result-body rendering (Render inspector tool results by content type #2066), readable Shell commands and embedded-language heredocs in approval's pretty tier (mecatui ask-args view: richer pretty tiers (heredoc highlight, && / || clause segmentation) #552), and child-call discoverability with honest preview limits (Show Subagent child tool activity in /toolcalls #2115). Assess Write's all-additions view and other tool-specific cases by reader value, not by completeness. Coordinate any missing reload data with Audit and restore mecatui session reload fidelity #2114 and structural work with refactor(mecatui): shrink and structure the UI package #2077 rather than duplicating those scopes.
  4. Preserve the approval integrity floor from ADR 0222: the sanitized, verbatim raw arguments stay one action away. Pretty-printing or syntax highlighting must not silently change the meaning of a command or mask dangerous lines. A colored Edit request is a view of arguments, not proof of an applied patch; failures and pending calls retain honest status.

Constraints and verification

  • Sanitize untrusted text before terminal styling; do not interpret tool output as trusted ANSI or expose credentials/media bytes. Keep theme contrast, narrow widths, wrapping/scrolling, selection/anchors, and full detail access.
  • Preserve a clear provenance boundary: top-level calls may have full received args/results; Subagent/Parallel/Team previews can be bounded, redacted, or unavailable after reload. Never fabricate child results, completeness, or success.
  • Exercise the same call through at least two consumers to catch drift, plus approval raw-vs-pretty, pending→result/error, hostile arguments, long output, and a fresh-client reload or an explicit absence where no durable source exists.

Related issues

Relates to #1361 and implementation PR #2089. Decide the shared presentation/data contract before splitting execution work; do not make this umbrella a blocker for independently reviewable child fixes.

Activity

  1. self-assigned this
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions