feat(app): add tool call detail levels#2031
Conversation
|
| 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]
%%{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]
Reviews (2): Last reviewed commit: "fix(app): address compact tool review fe..." | Re-trigger Greptile
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
compactToolCallspreference to Overview and normalize legacy in-memory settings cache shapes.Testing
Overview:

Concise:

Detailed (same as current):

Appearance Option:
