Skip to content

feat(chat): group exploration tool calls - #392

Merged
chriswritescode-dev merged 1 commit into
mainfrom
feat/group-tool-calls
Oct 7, 2026
Merged

chriswritescode-dev merged 1 commit into
mainfrom
feat/group-tool-calls

Conversation

@chriswritescode-dev

@chriswritescode-dev chriswritescode-dev commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Collapses consecutive read, search and fetch tool calls in the chat transcript into one expandable summary line, matching the OpenCode TUI's grouping.

  • New groupExplorationParts groups runs of read, glob, grep, webfetch and websearch within a message, using the same five tools and pluralized nouns as the TUI.
  • New ExplorationGroup renders the collapsed line (→ Explored: 5 reads, 2 searches, or Exploring: with a spinner while running) and reveals the individual tool rows on click.
  • Shell, edit, write, patch, sub-agent and text parts keep their own rows and break a run.
  • Hidden reasoning and blank text no longer split a group; a permission-blocked call stays visible below the collapsed line.
  • New groupToolCalls preference (default on) with a "Group exploration" toggle in Settings → General; "Expand tool calls" also opens groups by default.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation

Checklist

  • Code follows project style (no comments, named imports)
  • TypeScript types are properly defined
  • Tests added/updated (80% coverage target)
  • pnpm lint passes locally
  • pnpm typecheck passes locally

Frontend and backend typecheck clean; pnpm lint reports 0 errors (41 pre-existing no-explicit-any warnings). Full frontend suite passes (2310 tests) and backend settings and assistant suites pass (228 tests). New tests cover the grouping and label rules (explorationGroups.test.ts) and collapse/expand plus the disabled preference (MessageThread.test.tsx).

Summary by CodeRabbit

  • New Features
    • Consecutive exploration tool calls are grouped into collapsible summaries, with progress indicators and labels showing what was explored.
    • Grouping is enabled by default and can be turned off in General Settings when simple chat mode is disabled.

Collapse consecutive read, search and fetch tool calls in the chat transcript into one expandable summary line, matching the OpenCode TUI. Adds a groupToolCalls preference (default on) with a Settings toggle.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c1b457e6-a370-408a-9305-c172dd2e8588
📥 Commits

Reviewing files that changed from the base of the PR and between 81dd00e and 02d2e89.

📒 Files selected for processing (8)
  • frontend/src/components/message/ExplorationGroup.tsx
  • frontend/src/components/message/MessageThread.test.tsx
  • frontend/src/components/message/MessageThread.tsx
  • frontend/src/components/settings/GeneralSettings.tsx
  • frontend/src/lib/explorationGroups.test.ts
  • frontend/src/lib/explorationGroups.ts
  • shared/src/schemas/internal-assistant.ts
  • shared/src/schemas/settings.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Assistant messages can group consecutive exploration tool calls into collapsible summaries. The new groupToolCalls preference controls grouping, and General Settings provides a switch to change it.

Changes

Exploration tool grouping

Layer / File(s) Summary
Grouping preference
shared/src/schemas/settings.ts, shared/src/schemas/internal-assistant.ts, frontend/src/components/settings/GeneralSettings.tsx
The preferences schema and defaults include groupToolCalls, and the assistant settings patch accepts it. General Settings provides a switch for the preference.
Exploration grouping rules
frontend/src/lib/explorationGroups.ts, frontend/src/lib/explorationGroups.test.ts
Helpers group consecutive exploration tools, omit invisible content when forming groups, and generate labels based on tool names and completion status. Tests cover grouping and labels.
Message grouping and rendering
frontend/src/components/message/MessageThread.tsx, frontend/src/components/message/ExplorationGroup.tsx, frontend/src/components/message/MessageThread.test.tsx
MessageThread applies the preference and renders grouped content through ExplorationGroup. Tests cover collapsed summaries, expansion, and disabled grouping.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant MessageThread
  participant groupExplorationParts
  participant ExplorationGroup
  participant MessagePart
  MessageThread->>groupExplorationParts: Group assistant content when enabled
  groupExplorationParts-->>MessageThread: Return exploration groups and individual items
  MessageThread->>ExplorationGroup: Render grouped tool parts
  User->>ExplorationGroup: Select summary to expand
  ExplorationGroup->>MessagePart: Render each part when expanded
Loading

Merge Risk: ⚪ Minimal · up to 02d2e

This change adds grouped exploration tool calls with a default-on preference and a settings toggle. Older stored settings still load because defaults are merged first. No merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: grouping exploration tool calls in chat.
Description check ✅ Passed The description follows the repository template, identifies the new feature, documents the main behavior, and reports checklist and test status.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chriswritescode-dev
chriswritescode-dev merged commit 0045a74 into main Oct 7, 2026
2 checks passed
@chriswritescode-dev
chriswritescode-dev deleted the feat/group-tool-calls branch October 7, 2026 20:52
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