Skip to content

feat(agents): group sequential activity tools#1571

Merged
tellaho merged 7 commits into
mainfrom
tho/activity-row-grouping
Jul 7, 2026
Merged

feat(agents): group sequential activity tools#1571
tellaho merged 7 commits into
mainfrom
tho/activity-row-grouping

Conversation

@tellaho

@tellaho tellaho commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Category: improvement
User Impact: Agent activity feeds are quieter because routine consecutive tool work collapses into clearer summary rows with animated count updates as the work grows.
Problem: Consecutive tool calls made agent transcripts feel busy, especially when read/search/shell work alternated and defeated same-kind grouping. A first pass at broader grouping also exposed redundant nested summaries like Ran 16 tool calls expanding to Ran 12 commands.
Solution: This PR keeps user prompts, messages, failures, permissions, lifecycle/status, and metadata visible while broadening only eligible routine tool bursts into one mixed summary. Mixed summaries now expand directly to leaf tool rows, and count-led summary labels reuse the existing local AnimatedCount flourish instead of vendoring number-flow or adding a dependency.

File changes

desktop/playwright.config.ts
Removes obsolete screenshot/test wiring that no longer applies to the updated activity surface.

desktop/scripts/check-file-sizes.mjs
Drops a temporary file-size allowance that is no longer needed after the activity-scope cleanup.

desktop/src-tauri/src/managed_agents/personas.rs
Keeps persona test fixtures aligned with the current managed-agent activity assumptions.

desktop/src-tauri/src/managed_agents/personas/tests.rs
Updates managed-agent persona tests after removing observer/working-signal plumbing.

desktop/src/app/AppShell.tsx
Removes old app-level active-agent wiring now handled through the streamlined activity surfaces.

desktop/src/app/navigation/useAppNavigation.ts
Keeps navigation behavior aligned with the simplified activity/profile routing.

desktop/src/features/agents/activeAgentTurnsStore.test.mjs
Removes tests for the deleted active-agent turn store.

desktop/src/features/agents/activeAgentTurnsStore.ts
Simplifies active-turn tracking after removing the old activity signal store.

desktop/src/features/agents/agentWorkingSignal.test.mjs
Removes tests for the deleted agent working-signal helper.

desktop/src/features/agents/agentWorkingSignal.ts
Removes the old derived working-signal path in favor of the current transcript/session activity model.

desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx
Renders turn-grouped transcript segments, mixed tool-run summaries, flattened summary expansion content, and animated count-led summary labels.

desktop/src/features/agents/ui/ManagedAgentRow.tsx
Keeps managed-agent row activity display aligned with the updated activity model.

desktop/src/features/agents/ui/activityRenderClasses/ActivityRow.tsx
Adds support for splitting count-led summary objects so the numeric prefix can be rendered with AnimatedCount while preserving the readable label.

desktop/src/features/agents/ui/activityRenderClasses/activityRowLabelParts.test.mjs
Adds coverage for count-led label splitting and non-count label fallbacks.

desktop/src/features/agents/ui/agentSessionTranscript.test.mjs
Updates transcript expectations for status/lifecycle handling in the quieter activity feed.

desktop/src/features/agents/ui/agentSessionTranscript.ts
Keeps transcript item classification compatible with the new grouping and status guardrails.

desktop/src/features/agents/ui/agentSessionTranscriptGrouping.test.mjs
Adds coverage for same-kind grouping, mixed consecutive tool bursts, guardrails for failures/status/suppressed rows, steer context placement, flattened mixed-summary expansion, and burst boundaries.

desktop/src/features/agents/ui/agentSessionTranscriptGrouping.ts
Builds display blocks by turn, routes prompt/context metadata into the right UI affordance, groups eligible same-kind tools, groups broader mixed tool bursts, and prevents nested duplicate summaries.

desktop/src/features/agents/ui/useManagedAgentActions.ts
Keeps managed-agent action state compatible with the simplified activity signal flow.

desktop/src/features/agents/useAgentObserverIngestion.test.mjs
Removes tests for deleted observer-ingestion plumbing.

desktop/src/features/agents/useAgentObserverIngestion.ts
Removes old observer-ingestion state that is no longer needed for activity display.

desktop/src/features/agents/useOpenAgentActivity.test.mjs
Removes tests for deleted open-agent activity plumbing.

desktop/src/features/agents/useOpenAgentActivity.ts
Removes old open-activity state in favor of current profile/thread-panel activity entry points.

desktop/src/features/agents/usePreventSleep.ts
Keeps prevent-sleep behavior aligned with the updated agent activity lifecycle.

desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx
Adds breathing room to the activity transcript panel and keeps the thread panel aligned with the new display blocks.

desktop/src/features/channels/ui/BotActivityBar.tsx
Simplifies bot activity display now that transcript grouping carries more of the feed-noise reduction.

desktop/src/features/channels/ui/ChannelPane.tsx
Updates channel pane activity wiring to match the simplified agent activity model.

desktop/src/features/channels/ui/ChannelScreen.tsx
Keeps channel screen state aligned with the updated activity surfaces.

desktop/src/features/channels/ui/useChannelActivityTyping.test.mjs
Removes tests for deleted channel activity typing helper.

desktop/src/features/channels/ui/useChannelActivityTyping.ts
Removes old typing/activity helper that is no longer part of the current activity path.

desktop/src/features/profile/ui/UserProfilePanel.tsx
Keeps profile-panel activity entry points aligned with the updated agent session transcript panel.

desktop/src/features/profile/ui/UserProfilePanelSections.tsx
Updates profile section wiring for the simplified agent activity model.

desktop/src/features/profile/ui/UserProfilePopover.tsx
Keeps profile popover activity affordances aligned with the current activity flow.

desktop/src/features/sidebar/lib/useActiveWorkingChannelsById.ts
Simplifies active working-channel derivation after removing old agent working signals.

desktop/src/features/workspaces/useWorkspaceInit.ts
Removes initialization wiring for deleted activity/working-signal state.

desktop/src/testing/e2eBridge.ts
Updates the test bridge to support the current activity transcript scenarios.

desktop/tests/e2e/activity-scope-label-screenshots.spec.ts
Removes stale screenshot coverage for the previous activity-scope label behavior.

Reproduction Steps

  1. Open an agent activity transcript with a turn containing consecutive routine tool calls.
  2. Confirm same-kind runs still collapse into specific summaries such as Read 3 files or Ran 12 commands when they stand alone.
  3. Confirm mixed/interleaved routine bursts collapse into one summary such as Ran 16 tool calls.
  4. Expand that mixed summary and confirm it shows the underlying leaf tool rows directly, not a nested duplicate summary like Ran 12 commands.
  5. Let a live grouped tool burst grow and confirm the numeric count rolls with the existing odometer-style animation while reduced-motion users get static text.
  6. Confirm prompts, assistant/user messages, errors, permissions, status/lifecycle rows, and metadata boundaries remain visible instead of being swallowed by grouping.

Screenshots/Demos

Marge captured the latest build at 2e2a99b5 with a more realistic research/edit/verify turn. The screenshots show the intended two-tier drill-down: collapsed group, opened group with individual tool rows still closed, then one leaf row opened for detail.

State Preview What to look for
Collapsed image The whole research/edit/verify loop reads as one grouped summary row.
Group open, leaves closed image Opening the group reveals the tool-call sequence as collapsed leaf rows, without opening every result at once.
One leaf open image Each leaf can be expanded independently to inspect params and result details.

Regression proof — the earlier screenshot pair confirmed the nested-summary bug is gone: before the fix a mixed group expanded into a redundant nested Ran 12 commands row; after the fix it expanded directly to leaf tool rows.

Before After
image image

Validation

  • Marge reproduced the nested-summary bug at parent 85b244b7 and verified the fix at 9601b73a with before/after screenshots.
  • biome check . clean.
  • tsc --noEmit clean.
  • Full desktop unit suite passed at 1902/1902 after the AnimatedCount update.
  • Push hooks passed on 2e2a99b5.

Coordination: buzz://message?channel=2393ad5d-dbb4-4ea3-9b3b-36f432443238&thread=fc0758f5bcf34658ad3ed6bb13eb6fbbb7f65e3b48128381a774c57429b95ec0

npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w and others added 7 commits July 6, 2026 21:06
Add a fallback grouping pass that collapses adjacent eligible tool rows
of differing kinds into one 'Ran N tool calls' summary when the existing
same-kind pass leaves them expanded. Same-kind summaries keep their
specific labels and win over mixed grouping. Messages, permissions,
errors (including failed tools), and lifecycle/status rows break runs so
intervention points stay visible. Mixed summaries preserve child order,
expand to the original rows, and aggregate diff stats when edits are in
the run.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
…d grouping

Unify grouping eligibility across both passes: the same-kind pass now
uses the same isGroupingEligible gate as the mixed pass, so failed tools
(isError or renderClass error), status-like hook rows, and suppressed
rows can no longer collapse into a same-kind summary and always break
runs. Adds tests proving failed/status/suppressed runs stay expanded and
that an ineligible row splits a same-kind run.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
… dialog

Steer prompts (_goose/unstable/session/steer) upserted their prompt
context metadata without an acpSource, so display grouping never folded
it into the prompt bundle and it leaked as a standalone "Prompt
context" row after the sent-message bubble. Tag steer messages as
session/steer:user and their context as session/steer:context, then
have classifyTurnItems wrap each steer message as a prompt segment
whose context rides the existing checks-icon dialog. Steer contexts
pair to steer messages positionally; orphans keep a visible standalone
row so metadata is never silently dropped. Prompt segment keys now
include the user message id since a turn can hold several prompt
segments (initial prompt + mid-turn steers).

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Make the mixed pass interleave-tolerant: same-kind summaries produced
by the first pass now participate as burst children alongside leftover
eligible tool rows, so alternating investigation patterns (search →
read-summary → search → read-summary) collapse into a single
"Ran N tool calls" supervision row instead of many alternating rows.
Burst threshold drops to 2 segments. Mixed summaries carry ordered
child segments; nested same-kind summaries render intact and stay
expandable to their own rows, while flat leaf items preserve original
order for flattening and diff-stat aggregation. Messages, permissions,
failed tools, and status/suppressed rows still break bursts.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
…panel

The activity transcript in the agent session thread panel sat flush
against the bottom of the header row. Give the transcript container a
small y-padding (py-2) on the stacked child panel instead of touching
the global channel top-padding variable path.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Route the leading count in tool-run summary labels ("Ran 16 tool
calls", "Read 3 files") through the existing AnimatedCount odometer so
streaming bursts roll their digits as the count grows. Gated on the
transcript animation preference; prefers-reduced-motion falls back to
static text via AnimatedCount's existing CSS, and the sr-only value
keeps the label readable for screen readers.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho tellaho changed the title quiet agent activity tool bursts feat(agents): group activity tool bursts Jul 7, 2026
@tellaho tellaho changed the title feat(agents): group activity tool bursts feat(agents): group activity sequential tool Jul 7, 2026
@tellaho tellaho changed the title feat(agents): group activity sequential tool feat(agents): group activity sequential tools Jul 7, 2026
@tellaho tellaho changed the title feat(agents): group activity sequential tools feat(agents): group activity tool bursts Jul 7, 2026
@tellaho tellaho marked this pull request as ready for review July 7, 2026 08:53
@tellaho tellaho enabled auto-merge (squash) July 7, 2026 08:53
@tellaho tellaho changed the title feat(agents): group activity tool bursts feat(agents): group sequential activity tools Jul 7, 2026

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by Pinky (Buzz agent) on Wes's behalf.

Summary: Two-pass activity transcript grouping — same-kind runs collapse to specific summaries ("Read 3 files"), then adjacent eligible routine tool rows of differing kinds (including pass-1 summaries) collapse into one mixed "Ran N tool calls" summary that expands directly to leaf tool rows, eliminating redundant nested summaries. Also routes steer prompt-context behind the steer bubble's ingress dialog, de-dupes prompt segment keys per user message id, and animates summary counts via the existing AnimatedCount.

Verified:

  • Guardrails: messages, permissions, failed tools (isError/error renderClass), status, and suppressed rows never join either grouping pass and break bursts — intervention points stay visible. Explicit render-class allowlist rather than a denylist. All test-pinned.
  • No dropped data: mixed summaries keep flat items in original order, flattenDisplayBlocks order preserved (tested), orphan steer context keeps its standalone row rather than being silently dropped.
  • Bounded recursion: mixed summary children flatten to leaf rows, and mixed summaries never re-enter a burst (isBurstParticipant).
  • splitActivityRowCountedObject is strict (rejects bare counts / trailing whitespace); reduced-motion and sr-only handled by the existing component — no new dependency.
  • Staleness: 8 commits behind main; only overlap is one className line in AgentSessionThreadPanel.tsx vs main's prop refactor — git merge-tree clean.
  • All CI checks green; full desktop unit suite 1902/1902 per PR validation.

Non-blocking notes:

  • The "File changes" detail block in the description lists ~38 files but the diff is 8 — looks like leftover text from a broader branch. Worth trimming so history isn't misleading.
  • The child.kind === "summary" render branch in SameKindSummaryItem is currently unreachable (mixed children are always flattened) — fine for type-completeness, but a comment or removal would tighten it.

@tellaho tellaho merged commit 426f044 into main Jul 7, 2026
45 of 47 checks passed
@tellaho tellaho deleted the tho/activity-row-grouping branch July 7, 2026 15:34
tellaho added a commit that referenced this pull request Jul 7, 2026
…ivity

* origin/main:
  fix(desktop): hydrate reactions for Inbox context messages (#1596)
  fix: cleanup old screenshots that my agents committed (#1598)
  chore(release): release Buzz Desktop version 0.3.46 (#1585)
  fix(desktop): preserve agent model/provider when persona snapshot fields are blank (#1583)
  feat(acp,desktop): identify and reap stale agent harness processes (#1582)
  feat(desktop): active-draft badge, send-from-drafts confirm dialog, thread-deleted state (#1581)
  fix(desktop): treat baked build env vars as satisfying required agent config (#1580)
  feat(desktop): add "Copy image" to image right-click context menu (#1579)
  fix(nest): use buzz-dev symlink name for dev builds (#1587)
  fix(composer): address image-editor follow-up nits on #1491 (#1565)
  fix(desktop): render black static boot screen (#1570)
  feat(agents): group activity tool bursts (#1571)
  feat(desktop): aggregated overview rail, commit detail page, and full breadcrumbs (#1573)
  fix(desktop): fetch profiles for reaction actors and thread-reply authors (#1550)
  refactor(desktop): unify EditAgentDialog styling with PersonaDialog (#1540)
  feat(desktop): add 10-minute message grouping window (#1578)
  feat(desktop): unify sidebar section actions into a per-section ⋮ menu (#1577)
  feat(desktop): emoji avatar picker for agents + reliable picker scroll (#1576)

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
tlongwell-block pushed a commit that referenced this pull request Jul 7, 2026
* origin/main:
  docs(readme): add Getting started section routing install paths (#1606)
  fix(desktop): restrict shared-agent sync to dev data dirs (#1597)
  feat(desktop): restart-required badge from spawn-time config hash (#1602)
  feat(desktop): boot-time reconcile of managed agents to relay events (#1601)
  feat(desktop): canonical <PubKey> component — hover to view/copy full keys, owner "you" labels (#1589)
  fix(desktop): hydrate reactions for Inbox context messages (#1596)
  fix: cleanup old screenshots that my agents committed (#1598)
  chore(release): release Buzz Desktop version 0.3.46 (#1585)
  fix(desktop): preserve agent model/provider when persona snapshot fields are blank (#1583)
  feat(acp,desktop): identify and reap stale agent harness processes (#1582)
  feat(desktop): active-draft badge, send-from-drafts confirm dialog, thread-deleted state (#1581)
  fix(desktop): treat baked build env vars as satisfying required agent config (#1580)
  feat(desktop): add "Copy image" to image right-click context menu (#1579)
  fix(nest): use buzz-dev symlink name for dev builds (#1587)
  fix(composer): address image-editor follow-up nits on #1491 (#1565)
  fix(desktop): render black static boot screen (#1570)
  feat(agents): group activity tool bursts (#1571)
  feat(desktop): aggregated overview rail, commit detail page, and full breadcrumbs (#1573)
  fix(desktop): fetch profiles for reaction actors and thread-reply authors (#1550)
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.

2 participants