Skip to content

Roll up back-to-back agent exchanges in the timeline - #4831

Closed
brsbl wants to merge 11 commits into
bb/improve-how-agent-to-agent-messages-are-thr_4u5mgu9qe7from
bb/roll-up-agent-conversations
Closed

brsbl wants to merge 11 commits into
bb/improve-how-agent-to-agent-messages-are-thr_4u5mgu9qe7from
bb/roll-up-agent-conversations

Conversation

@brsbl

@brsbl brsbl commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

When agents trade several messages, each exchange adds a "Message from" row, a "Message to" row, and the agent's reply to the receiving thread. In coordinating threads these back-to-back exchanges push the messages meant for the user out of view.

What changed

  • Two or more back-to-back exchanges started by other agents collapse into one "Agent conversation · N messages" row. N counts the agent messages sent and received.
  • Expanding the row shows every exchange as before.
  • Exchanges stay expanded when they are live, unread, user-steered, pending, from a side chat, or the target of search or navigation.
  • This works on any install, including sends from bb thread tell. The "Message to" rows need the Agent messages plugin.

How you verified

  • New tests cover grouping, the message count, and each case that must stay expanded.
  • Chrome for Testing: three back-to-back exchanges collapsed into "Agent conversation · 6 messages", and expanding the row showed each exchange.
  • Remote CI passed on 270ddb63df: 31 checks passed and 3 were skipped.

Before: 62a8531898. After: e81212789f. Captured before the stack was rebased onto main c201f6490a; the rebase and the dropped Claude Code change don't touch the timeline. Same dev database, thread, and viewport, captured at 2×.

Screen / state Viewport Before After
Calendar worker (receiver) Desktop 1440×900 Before receiver After receiver, collapsed
Calendar worker / conversation expanded Desktop 1440×900 Before receiver, same scroll position After receiver, expanded

BB-Thread-ID: thr_h86jusyw6k

🤖 Generated with Claude Code

AGENT GENERATED

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@brsbl
brsbl added this pull request to stack #4823 October 4, 2026 00:22
@brsbl
brsbl removed this pull request from stack #4823 October 4, 2026 02:10
@brsbl
brsbl changed the base branch from bb/always-load-bb-tools-in-claude-code to bb/improve-how-agent-to-agent-messages-are-thr_4u5mgu9qe7 October 4, 2026 02:10
@brsbl
brsbl added this pull request to stack #4834 October 4, 2026 02:10
brsbl and others added 9 commits October 3, 2026 19:37
Add the bundled Agent messages plugin with a bb_thread_message tool. An agent
messages another thread, or answers one that messaged it, through the tool,
and addresses the user in its normal response. The receiver already shows
"Message from"; the sender now shows the tool call as a matching "Message
to" chip outside the turn's work summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The thread id reached the SDK's unencoded URL path, so a crafted id could
traverse to other loopback API routes or bypass the self-send guard. Accept
only a single id segment, and render chips only for canonical thread ids.

A side chat's forwarded message reads as an agent message in its main
thread; refuse to message side chats so the main agent answers the user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tell agents the timeline already shows messages they send and receive, so
they should not announce or restate them, and to prefer bb_thread_message
over bb thread tell unless they need its options. Only lift successful or
in-flight calls out of the work summary, so a failed attempt stays folded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collapse two or more settled agent-started exchanges into one Agent
conversation row, skipping live, user-steered, pending, pinned, and
side-chat exchanges. Explain in the tool's instructions what
bb_thread_message and bb thread tell each offer, keep that out of the core
bb-cli skill, and keep the tool result to delivery status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Write the tool instructions as one short imperative paragraph like core bb
tool guidance, listing only the bb thread tell options agents need. Keep
GeneratedConversationMessage's existing layout, inline the side-chat check,
and collapse overlapping test cases into tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Treat the live row and the first unread row as pinned, so one rule keeps
those exchanges expanded instead of separate active-turn and divider
handling. Render the Message to row in ThreadTimelineRows from its contexts
like ConversationRow, and print grouped rows flat in CLI text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brsbl
brsbl force-pushed the bb/improve-how-agent-to-agent-messages-are-thr_4u5mgu9qe7 branch from 258f7b7 to a9f3fc9 Compare October 4, 2026 02:39
@brsbl
brsbl force-pushed the bb/roll-up-agent-conversations branch from 338dbef to 4aee2bd Compare October 4, 2026 02:39
brsbl and others added 2 commits October 3, 2026 20:19
The bb-guide introduction applies to every agent, so the exception for
answering an agent now lives in the plugin's own instructions and the core
line is unchanged. The tool refuses recipients that run with broader
permissions than the sender, because bb tools skip the sender's approvals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collapse two or more settled exchanges started by other agents into one
Agent conversation row that counts the agent messages exchanged. Exchanges
that are live, unread, user-steered, pending, from a side chat, or targeted
by search or navigation stay expanded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brsbl
brsbl force-pushed the bb/roll-up-agent-conversations branch from 4aee2bd to 270ddb6 Compare October 4, 2026 03:19
@brsbl
brsbl force-pushed the bb/improve-how-agent-to-agent-messages-are-thr_4u5mgu9qe7 branch from a96bc1e to ec663e6 Compare October 4, 2026 05:46
@brsbl
brsbl removed this pull request from stack #4834 October 4, 2026 09:51
@brsbl

brsbl commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: we're dropping the roll-up. Each agent message already collapses to one line, and the roll-up hid the agent's answers to the user and re-rendered every timeline row on any thread change.

AGENT GENERATED

@brsbl brsbl closed this Oct 4, 2026
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