Repository navigation
Description
Item 10 of 11 in the Crews: organic teamwork milestone. Last in line on purpose.
The problem
Telling the whole crew something ("the API shape changed," "stop, we're switching approach," "PR is up") takes one j5_send_message per seat. It's tedious, agents skip people, and every send is its own message the receiver has to process.
Where this sits
This is the last communication item because it's the one most likely to make the queue problem worse if it lands first: a crew-wide send to 5 seats is 5 more queued messages. With #677 (busy seats read everything in one turn) and #683 (progress goes on the notepad, not in messages), the cases left for a crew-wide message are rare and real: a change of plan, a stop, a shared blocker.
First step: decide whether we still need it. After #677 and #683 ship, look at whether Captains are still sending the same message to every seat one at a time. If they aren't, close this.
Definition
The docs PR on j5/crew-teamwork-docs writes the end state into the definitions, so read these first; this issue builds to them. It's in the "Later" list of Crews, not in the definition. If we build it, the same PR moves it out of Later and into the definitions.
What we already have
j5_send_message:SendService.ts, tool inapps/server/src/j5/a2a/mcp/tools.ts:681, doc indocs/j5/product/a2a/agent-tools.md.- Crew members:
AgentCrewInstanceService.ts. The crew filter from Crews: crew-aware address book in j5_list_participants #680 gives the same set.
Proposal
j5_send_message accepts a crew as the recipient (to_crew: crew_instance_id). It's a plain send only, and it becomes one ordinary message per recipient, so delivery, receipts, folding, and not-delivered notices all work exactly as they do for single sends.
Acceptance criteria
- Before building, the PR (or a comment here) shows whether Captains still send the same message to every seat after Crews: a busy agent reads every message that arrived in one catch-up turn #677 and Crews: a shared crew notepad (Captain plan page plus one page per seat) #683. If not, close this as not needed.
to_crewis accepted from that crew's Captain and its live seats. Anyone else is refused, naming the crew's Captain as who to message.- A crew send is plain only:
expect_reply,exchange_id,regarding,mode, andurgencyare refused with it, naming a single send as the way to ask. - It goes to every live seat and the Captain except the sender, as one ordinary message each, and they share an id that ties them together.
- The result lists each recipient's outcome (queued, delivered, or refused with the reason).
- Each recipient's envelope says it went to the whole crew.
docs/j5/product/a2a/agent-tools.mdis rewritten for the field.- Focused tests cover: fan-out from the Captain and from a seat, non-member refused, asks refused, and per-recipient results.
Dependencies
- Blocked by Crews: a busy agent reads every message that arrived in one catch-up turn #677, so a crew send doesn't multiply queued turns.
- Blocked by Crews: a shared crew notepad (Captain plan page plus one page per seat) #683, to see whether this is still needed.
- Reads better with Crews: message envelopes name the sender and how they relate to you #679.
Activity