Repository navigation
feat(a2a): warn senders when the receiver is mid-turn with messages waiting - #426
Merged
Merged
Conversation
…aiting A message to a busy agent queues as its own run, so a stream of small updates becomes a stream of receiver turns. send_message now returns a deliveryNotice when the receiver is an agent on this server that is mid-turn and won't take the message into that turn (anything but a running Astra turn): how many A2A messages are waiting, how many are the caller's, and to put further updates in one message. The read is advisory and never fails the send. The send tool description, the Crew coordination instruction, the seat brief and the propose_crew description stop inviting a message per intermediate finding. The A2A definition gains AC29. Refs #424. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Opus review of #424. A replayed send of a message that already ran no longer counts it as waiting, and a held queue gets no notice, since it drains only when someone resumes the thread (#272 owns telling the sender). t3_thread_send_attachments returns the same notice through a shared helper. The definition drops the peer-server gap (#425 tracks it) and the tool description says the notice is about waiting, not busyness. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Astra review of #424. The backlog now counts committed deliveries the worker has not handed to the receiver yet (it can sit behind a 30-second Astra steer acknowledgement), attributes them to their real sender, and counts the sent message from its own ledger state instead of assuming it waits. A message already queued for an Astra receiver stays queued when that turn becomes steerable, so it is counted. Astra's three reproductions are kept as regression cases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Opus re-review of #424. The worker commits a run before it marks the delivery delivered, so reading pending rows first means every message shows up in at least one read. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
This review includes 16 billable files and costs up to $4.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 34 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Your 52 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (16)
Comment |
This was referenced Oct 3, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A message to an agent whose turn is running is queued as its own run, so a stream of small updates becomes a stream of turns for the receiver. Agents, Astra senders most of all, have queued up to 11 messages on one Claude thread here (40 seen elsewhere), and the receiver tends to answer each one. Our own Crew instruction invited it ("share intermediate findings … as soon as useful"). Letting peer messages steer Claude instead is not an option: a live test on Claude Code 2.1.287 showed a
priority: "now"steer cancels a pending sibling tool call with a fake "The user doesn't want to take this action" refusal (see #424).Closes #424.
What changed
send_messageandt3_thread_send_attachmentsreturn adeliveryNoticewhen the receiver is mid-turn and won't take the message into that turn. It says how many messages are waiting for the receiver, how many are the caller's, that each runs as its own turn, and to put further updates in one message. A send to an idle receiver or a running Astra turn gets no notice.apps/server/src/j5/a2a/receiverBacklog.tsreads it when the tool is called. It counts the receiver's queued A2A runs plus committed deliveries the worker hasn't handed over yet. Nothing is stored. The read is advisory, so a failure is logged and the send still succeeds.send_messagedescription gains one sentence. The Crew coordination line stops asking for findings "as soon as useful" and asks for them grouped into one message. The seat brief and thepropose_crewdescription drop "intermediate findings" to match.envelopes.v1.jsonis bumped to version 20.docs/j5/product/a2a/index.mdgains one Delivery paragraph, AC29 and a History line.agent-tools.mdfollows the tool description and result.Rejected in #424: merging queued messages into one turn, refusing sends past a limit, and a "queue cleared" notice.
For Jackson to approve here (the A2A wording in
envelopes.v1.jsonis human-owned):Review and testing
Independent panel: Opus 5.5 (code lead) and Astra (code review plus live test), each in its own checkout.
What they found and how it was fixed:
client_request_idcounted a message that had already run. Fixed; it now reports the current state.Every reproduction is kept as a regression test.
Live test (Astra). An isolated dev server with a scratch project and real agents:
Automated. 80 tests pass across the touched test files, including integration tests against a real orchestrator: idle, the message's own run, retry, pending before drain, pending plus queued, another sender, Astra queued while starting, running Astra, held queue, and an unknown receiver. Server typecheck and lint are clean.
Upstream impact
apps/server/src/provider/T3OrchestrationInstructions.ts: wording change to the J5 Crew line inside the existing seam, FORK.md case 8. Case 8 already covers authorized wording changes and the file-table row exists, so FORK.md is unchanged.Checklist
FORK.md(case text and file-table row) in this PR (existing case 8; no new edit needed)send_message,t3_thread_send_attachments). The machine HTTP sender is unchanged.agent-tools.mdare updated. No user docs, since this is agent-facing behavior.Built by Claude Opus 5.5 (1M context) in Claude Code. Reviewed by Claude Opus 5.5 and GPT-6-Astra peer agents.
🤖 Generated with Claude Code