Skip to content

feat(app): add tool call detail levels#2031

Open
mcowger wants to merge 5 commits into
getpaseo:mainfrom
mcowger:compact-tool-display-pr
Open

feat(app): add tool call detail levels#2031
mcowger wants to merge 5 commits into
getpaseo:mainfrom
mcowger:compact-tool-display-pr

Conversation

@mcowger

@mcowger mcowger commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds configurable tool-call detail levels so long agent turns can stay scannable without removing access to individual tool output. Users can choose a one-line activity overview, a concise grouped breakdown, or the original detailed per-tool timeline; existing users remain on Detailed unless they previously enabled compact tool calls.

Changes

  • Appearance settings: replace the compact-tool boolean with an Overview, Concise, and Detailed selector stored per client.
  • Overview: summarize contiguous tool runs as localized past-tense activity, including edited/read files, commands, searches, other tools, and Paseo calls.
  • Concise: group calls by tool type with counts and basename resource previews, while preserving full chronological rows on expansion.
  • Detailed: retain the existing ungrouped per-tool timeline and keep it as the default.
  • Live behavior: compact running calls without changing the group row key, preserving expansion state and scroll anchoring as new calls arrive.
  • Compatibility: migrate the previous compactToolCalls preference to Overview and normalize legacy in-memory settings cache shapes.
  • Localization: add selector and summary copy for every supported app language.

Testing

  • Added focused coverage for preference defaults/migration/cache normalization, grouping boundaries, stable live host IDs, category summaries, duplicate basenames, and direct Brave/Paseo runtime tool names.
  • Manually exercised mixed live sequences containing file writes/edits, shell commands, web searches, glob/grep calls, and Paseo tools in the web app across the three presentation iterations.

Overview:
Screenshot 2026-07-12 at 2 28 45 PM

Concise:
Screenshot 2026-07-12 at 3 08 34 PM

Detailed (same as current):
Screenshot 2026-07-12 at 3 08 50 PM

Appearance Option:
Screenshot 2026-07-12 at 3 09 43 PM

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the single compactToolCalls boolean with a three-level toolCallDetailLevel setting ("overview", "concise", "detailed"), migrates existing preferences forward, and adds the corresponding rendering components, grouping logic, and localization for all eight supported languages.

  • tool-calls/grouping.ts: new compactToolCallRuns function collapses contiguous runs of ≥ 4 compactable calls into a stable-host group, spanning the tail/head boundary for live streams, with full category summary and resource deduplication.
  • tool-call-group.tsx: new component renders overview (single-line summary) or concise (title + per-category rows) modes, with expand-to-full-detail toggle and correct accessibility state.
  • storage.ts + index.ts: normalizeAppSettings handles both the new field and the legacy compactToolCalls shape, ensuring stale in-memory cache entries are migrated before any write.

Confidence Score: 5/5

Safe to merge — the feature is well-contained, the migration path is tested and correct, and no existing rendering behavior is altered for users on the default "detailed" level.

The grouping logic is thoroughly unit-tested across all boundary conditions. The settings migration from the old compactToolCalls boolean is validated in both the load and the save path. React hook dependencies are correctly specified, and the normalizeAppSettings guard prevents stale in-memory cache shapes from corrupting saved state. No current defects were found.

No files require special attention.

Important Files Changed

Filename Overview
packages/app/src/tool-calls/grouping.ts New module implementing compactToolCallRuns — correctly handles cross-boundary grouping, stable host IDs, and category counting; well-tested.
packages/app/src/tool-calls/grouping.test.ts Comprehensive tests covering all major paths: disabled mode, cross-boundary grouping, minimum threshold, category counting, Paseo classification, and duplicate resource deduplication.
packages/app/src/components/tool-call-group.tsx New component for overview/concise group presentation; clean accessibility state, stable callbacks, correct concise-vs-overview branching.
packages/app/src/hooks/use-settings/storage.ts Adds ToolCallDetailLevel type, normalizeAppSettings, and migration path from legacy compactToolCalls boolean; validation set and parsing logic are consistent with existing patterns.
packages/app/src/hooks/use-settings/storage.test.ts Tests cover default value, migration from enabled/disabled compact toggle, explicit level loading, and legacy cache normalization in saveAppSettings.
packages/app/src/agent-stream/view.tsx Integrates compaction via useMemo before layout, adds expandedToolCallGroupIds state, renames inner helper to renderSingleToolCallItem, and dispatches to ToolCallGroup when a group exists.
packages/app/src/hooks/use-settings/index.ts Wraps useAppSettings data in normalizeAppSettings via useMemo and wires toolCallDetailLevel through the settings update path.
packages/app/src/screens/settings/appearance/appearance-section.tsx Adds ToolCallDetailRow with a dropdown menu, stable module-level style array, and handleToolCallDetailLevelChange callback; follows existing row patterns cleanly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Stream items: tail + head] --> B{toolCallDetailLevel}
    B -->|detailed| C[Pass through unchanged - no compaction]
    B -->|overview or concise| D[compactToolCallRuns - 4+ contiguous calls become a group]
    D --> E{run length >= 4?}
    E -->|No| F[Render individually as before]
    E -->|Yes| G[Create CompactToolCallGroup - stable host id = first call id]
    G --> H{Expanded?}
    H -->|No, overview| I[One-line activity summary]
    H -->|No, concise| J[Title + per-category rows]
    H -->|Yes| K[Full per-call timeline]
    C --> L[Existing detailed per-call rendering]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Stream items: tail + head] --> B{toolCallDetailLevel}
    B -->|detailed| C[Pass through unchanged - no compaction]
    B -->|overview or concise| D[compactToolCallRuns - 4+ contiguous calls become a group]
    D --> E{run length >= 4?}
    E -->|No| F[Render individually as before]
    E -->|Yes| G[Create CompactToolCallGroup - stable host id = first call id]
    G --> H{Expanded?}
    H -->|No, overview| I[One-line activity summary]
    H -->|No, concise| J[Title + per-category rows]
    H -->|Yes| K[Full per-call timeline]
    C --> L[Existing detailed per-call rendering]
Loading

Reviews (2): Last reviewed commit: "fix(app): address compact tool review fe..." | Re-trigger Greptile

Comment thread packages/app/src/components/tool-call-group.tsx
Comment thread packages/app/src/agent-stream/view.tsx
Comment thread packages/app/src/tool-calls/grouping.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant