Skip to content

Crews: crew-aware address book in j5_list_participants #680

Closed as not planned

Description

@bryantderosier

Item 4 of 11 in the Crews: organic teamwork milestone.

The problem

j5_list_participants is every agent's address book, and it knows nothing about crews. A row has a display name, a participant id, placement, and provenance, but no crew name, no seat, no "this is a Captain," and no responsibility. So:

  • A seat that wants "whoever's doing review on my crew" has to guess from thread titles.
  • A Captain that wants to coordinate with the Captain of another crew has no way to find them except titles. That's the cross-crew case in the fleet vision, where leads each run several PR Groups.
  • When one Captain runs several crews, nothing says which seat belongs to which.

Where this sits

This is the lookup half of "crewmates know each other": #679 puts names on messages, this issue puts crews in the address book, and #681 pushes roster changes to the crew. It's also the cheapest fix for crews finding each other, since nothing else exists for that today.

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. Agent tool surface AC39 (the crews field, the filter, and its refusal) and Crews AC26.

What we already have

  • Tool and handler: J5ListParticipantsTool in apps/server/src/j5/a2a/mcp/tools.ts:695 and the handler in apps/server/src/j5/a2a/mcp/handlers.ts (around line 234), reading through RosterService.ts.
  • Live crews, members, seat names, reasons, and Captains: AgentCrewInstanceService.ts. The reason on each member is the responsibility the person approved.
  • fleetRead.ts:31 already builds a participant → crew seat map for the Fleet page, so that's the pattern to follow.
  • The documented contract: docs/j5/product/a2a/agent-tools.md, section j5_list_participants.

Proposal

Each agent row gains a crews list covering every live crew the agent is in:

"crews": [
  { "crew_instance_id": "…", "crew_name": "Invoice Export", "role": "member", "seat": "Critic", "responsibility": "Independent review of the export PR" },
  { "crew_instance_id": "…", "crew_name": "Pricing Copy", "role": "captain" }
]

Add a crew_instance_id filter that lists that crew's Captain and seats.

Acceptance criteria

  1. Each agent row on this server carries crews: every live crew the agent captains or holds a seat in, with crew id, crew name, role, and for a member its seat name and approved responsibility. An agent in no crew gets an empty list.
  2. A crew_instance_id filter returns that crew's Captain and live seats (plus the caller's own row and the people, as every listing does today). An unknown or retired crew id is refused, naming j5_list_participants without the filter.
  3. Retired crews don't appear in crews.
  4. Peer-server rows leave crews out. A peer server doesn't report crews, and the doc says so.
  5. The tool description says when to use the filter ("find your crewmates" and "find another crew's Captain") in a sentence or two, not a paragraph.
  6. The quoted tool descriptions in agent-tools.md stay as shipped until the code changes them, so this PR updates the shipped description and its quoted copy together (EnvelopeFormatter.test.ts compares the j5_send_message one). The field and filter are already in agent-tools.md.
  7. Focused handler tests cover a member, a Captain of two crews, a solo agent, a retired crew, and the filter.

Dependencies

Activity

  1. added
    enhancement
    size:S
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsize:S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions