Skip to content

feat: unified ephemeral activities for parallel tool calls (CYPACK-886)#937

Open
cyrusagent wants to merge 2 commits intomainfrom
cypack-886
Open

feat: unified ephemeral activities for parallel tool calls (CYPACK-886)#937
cyrusagent wants to merge 2 commits intomainfrom
cypack-886

Conversation

@cyrusagent
Copy link
Copy Markdown
Contributor

@cyrusagent cyrusagent commented Mar 5, 2026

Assignee: Connor Turland

Summary

When Claude runs multiple tools in parallel (e.g., 6 Explore agents simultaneously), each tool was previously posted as a separate activity in the Linear timeline, creating a cluttered, broken-looking view. This PR introduces unified ephemeral activities that present all parallel tools in a single tree-like view with live status updates, matching Claude Code's native parallel agent display.

Before: Individual activities flood the timeline for each parallel tool call
After: One compact ephemeral activity with tree formatting (├─/└─) and status icons (⏳/✅/❌) that updates progressively as tools complete

Changes

  • packages/core/src/agent-runner-types.ts — Added formatParallelToolGroup() to the IMessageFormatter interface
  • packages/edge-worker/src/AgentSessionManager.ts — Core parallel detection and unified activity posting:
    • extractAllToolInfo() / extractAllToolResultInfo() to detect multiple tool blocks per message (replacing single-block .find())
    • parallelToolGroups Map for tracking concurrent tool groups per session
    • postParallelGroupActivity() posts unified ephemeral activities with progressive status updates
    • Individual result activities suppressed for parallel groups; single-tool fallback preserved
  • packages/{claude,codex,cursor,gemini}-runner/src/formatter.tsformatParallelToolGroup() implementation with tree-like markdown formatting
  • packages/edge-worker/test/AgentSessionManager.parallel-tools.test.ts — 11 new tests

Testing

  • 11 dedicated tests covering: parallel detection, ephemeral posting, result suppression, partial updates, single-tool fallback, formatter output, status icons, error handling, parameter truncation
  • All 548 edge-worker tests pass across 44 test files
  • Full typecheck and lint clean across all packages

Linear Issue

CYPACK-886

cyrusagent and others added 2 commits March 4, 2026 19:20
When Claude runs multiple tools in parallel, instead of posting separate
activities for each tool, present a single unified ephemeral activity
with a tree-like view showing all parallel tools and their status.

- Add extractAllToolInfo/extractAllToolResultInfo to detect parallel
  tool_use blocks in assistant messages
- Track parallel tool groups per session with progressive status updates
- Post unified ephemeral activities with tree formatting (├─/└─ with
  ⏳/✅/❌ status icons)
- Suppress individual result activities for parallel groups
- Add formatParallelToolGroup to IMessageFormatter and all 4 runners
- Add 11 tests covering parallel detection, ephemeral posting, result
  suppression, partial updates, and single-tool fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cyrusagent cyrusagent marked this pull request as ready for review March 5, 2026 03:21
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