Skip to content

OPE-144: Collapse consecutive tool calls #459

Closed

Description

@ivanfenenko

Optionally collapse back-to-back tool calls in Session Chat into one summary Tool Call Card. Settings → Appearance toggle; default off.

Remaining:

  • Open pull request and merge.

Completed:

  • Session Chat display preference (collapse consecutive tool calls, default off)
  • Settings → Appearance toggle on iOS and Android
  • Widen SessionChatTimelineBlocks grouping when preference is on (all families, ≥2 consecutive)
  • Keep OPE-50 context-only grouping when preference is off
  • Mixed-family group title counts
  • Option E group chrome (N tools + family one-liner) and tool group screen
  • Group status via the Tool Call Card dot only (no status-colored outline)
  • Clear All Data resets the preference
  • Unit tests for on/off grouping rules on both platforms
  • Live re-project when preference flips while Session Chat is open

Docs: docs/features/collapse-consecutive-tool-calls/

Related: OPE-46 Assistant Tool Parts, OPE-50 Lightweight tool chrome (baseline context groups).


Problem Statement

Long assistant turns fire many tool calls one after another. Each becomes its own Tool Call Card, so Session Chat gets noisy and hard to scan. Users who want a denser view have no way to collapse sequential tools.

Today only consecutive context tools (read / glob / grep) auto-group, and that behavior is always on with no settings control.

Solution

Add a Settings → Appearance toggle Collapse consecutive tool calls (off by default).

When on, a run of two or more consecutive tool-call messages (Shell, Edit, Read, and other non-task tools) collapses into one tool group summary card. That is the primary case: some models emit one tool per assistant message, stacked. Tools that share one message also group. task never groups.

When off, keep today’s behavior: only consecutive context tools auto-group; other tools stay individual Tool Call Cards with specialized chrome and taps.

User Stories

  1. As a mobile user, I want a Settings toggle to collapse sequential tool calls, so that long tool runs are easier to scan.
  2. As a mobile user, I want the toggle off by default, so that specialized tool chrome and taps stay available until I opt in.
  3. As a mobile user, I want the control under Appearance, so that I find it with other display preferences.
  4. As a mobile user, when collapse is on, I want any back-to-back tools (not only read/glob/grep) to group, so that mixed tool runs also densify.
  5. As a mobile user, I want a single tool to stay a normal card, so that one-off tools remain clear.
  6. As a mobile user, I want text or attachments between tools to break a group, so that the structure of the turn stays readable.
  7. As a mobile user, I want group status to reflect the worst member state, so that errors and running work remain visible.
  8. As a mobile user, I want a compact group card (N tools plus a family one-liner like Edit · Write · 5 shells), so that I can scan what ran without a census of raw tool names.
  9. As a mobile user, I want tapping the group to open a tool group screen of member Tool Call Cards, so that I can review edits (Changes) and inspect shells without an in-list accordion. Status is the card dot only — no colored outline on the message.
  10. As a mobile user, I want changing the toggle to update an open Session Chat immediately, so that I do not restart the app.
  11. As a mobile user, I want Clear All Data to reset the preference, so that wipe behaves consistently with other display prefs.
  12. As a developer, I want the same pure grouping rules and tests on iOS and Android, so that parity holds.
  13. As a mobile user, I want hide rules unchanged (todowrite always hidden; in-flight question hidden), so that collapse does not resurrect hidden tools.
  14. As a mobile user, when collapse is off, I still want consecutive context tools grouped as today, so that existing dense context runs do not regress.

Implementation Decisions

  • Presentation-only; no server API or ToolPart schema changes.
  • Primary seam: pure Session Chat timeline block builders (SessionChatTimelineBlocks on both platforms). Pass the collapse preference into build.
    • Preference on: group any consecutive visible tools when count ≥ 2.
    • Preference off: keep OPE-50 context-only grouping.
  • Hide rules apply before grouping.
  • Reuse existing Tool Call Card for groups; no new design-system component.
  • New device-local boolean preference (default false), Settings list-item + switch in Appearance, included in Clear All Data. Follow existing preference patterns (HomeDisplayPreferences / equivalent Session Chat display prefs).
  • Group block IDs stay ordered member part IDs; status worst-of (error > running/pending > completed); first error text when present.
  • Group card copy is option E: title N tools; subtitle family one-liner in encounter order. Human labels (Shell, not bash).
  • Tap pushes a tool group screen of member Tool Call Cards (back, N tools, family subtitle). File-change members open Changes; shell/network members open the existing tool-detail sheet. No in-list accordion.
  • Status is the Tool Call Card dot only; hairline stays border.weaker (no status-colored outline).
  • Live rebuild when parts/status update or the preference flips.

Testing Decisions

  • Test external timeline-block output of the pure builders, not UI wiring internals.
  • Cases:
    • toggle off + consecutive context → one group
    • toggle off + mixed tools → separate cards (context still groups among themselves)
    • toggle on + mixed consecutive tools → one group
    • text/attachment breaks group
    • single tool never groups
    • hide rules still apply
    • worst-of status
    • title counts for mixed families
    • preference defaults false
    • Clear All Data resets preference
  • Prior art: SessionChatTimelineBlocks tests on both platforms.

Out of Scope

  • In-group expand / accordion
  • Cross-message aggregation across user turns, or across visible text / attachments / task tools
  • Grouping across text interruptions
  • Per-session override of the preference
  • New design-system component
  • Domain ToolPart schema or server API changes
  • Push / background sync

Further Notes

Canonical docs: docs/features/collapse-consecutive-tool-calls/

Baseline behavior from OPE-50 context tool groups remains when the new toggle is off.


Imported from Linear OPE-144. Linear status: Done. Priority: Medium. Created 2026-08-12. Completed 2026-08-14.
Related: OPE-50, OPE-46, OPE-171, OPE-163.

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. added
    enhancement
    ios
    android
    shared
    priority: medium
    ready-for-agent
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

androidenhancementiospriority: mediumready-for-agentshared

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions