Repository navigation
Description
Item 6 of 9 in the Crews: organic teamwork milestone.
The problem
Agents have too many ways to get help: native subagents, delegate_task, j5_spawn_agent, j5_propose_crew, and j5_request_crew_member. The guidance reads like a menu, so agents reach for a Crew because I said "crew", or spawn a standalone Peer Agent when a subagent would do. Inside a Crew, review rounds go through the Captain. The reviewer tells the Captain, the Captain relays it to the builder, and the builder reports back, with acknowledgments and progress chatter in between. When a member sends something important, it can't tell whether it landed in a running turn, is queued, or failed.
Where this sits
This is the "Choosing a team", "Spawning paths", and "Coordination" rows of Crews proposal v2 (25 October). The agent chooses from context:
- Work directly when delegation wouldn't help.
- Subagents for independent assignments.
- A Crew for iterative peer collaboration.
There are two agent-facing paths, create a subagent or add a Crew member. Members own their review loops, and the Captain owns the outcome.
What we already have
-
Standing instructions:
packages/provider-core/src/j5/orchestrationInstructions.ts:11-29, J5-owned. Upstream's constant points at this text (FORK.md case 8), so changing the wording needs no upstream edit. Persona mentions come fromagentInvocationInstructions.ts. -
Member first-turn rules: the
<crew_collaboration>block inapps/server/src/j5/a2a/spawnIds.ts:129. -
Tools in
apps/server/src/j5/a2a/mcp/tools.ts:j5_spawn_agent(:569)j5_propose_crew(:575)j5_request_crew_member(:578)j5_send_message(:685)
-
delegate_tasklives inapps/server/src/j5/agents/agentDelegation.ts:39-43. Crew members are refusedj5_spawn_agent(mcp/handlers.ts:416-417). -
Steering: active Codex GPT 6 and Claude runs accept peer steering (Claude after its running tool calls finish, fix(server): agent messages join a busy Claude agent's turn instead of queueing #690). Cursor and the rest queue until the next turn boundary (
DeliveryTransport.ts:254-288). -
What a sender learns today:
- the advisory
deliveryNotice(backlog, held queue, usage limit;receiverBacklog.ts:46-56); waiting_for_recipientfor an offline peer;- one alarm when delivery may have failed.
There's no per-message "steered", "queued", or "delivered" outcome.
- the advisory
-
Tests:
orchestrationInstructions.test.tspins the wording, andEnvelopeFormatter.test.tscompares thej5_send_messagedescription to agent-tools.md.
Proposal
- Choosing: rewrite the standing instructions around the three choices. Keywords like "crew" don't decide it. The agent can reassess mid-work and carry findings forward.
- Two paths: agents create a subagent (native, or
delegate_taskacross providers) or add a Crew member.j5_spawn_agentstays for when the user explicitly asks for a standalone agent they'll talk to, and for existing callers. It stops being something agents pick on their own. - Review loops: members send review findings and fixes to each other directly. The Captain hears only a review pass, a blocker, or a disagreement they couldn't settle. Acknowledgments and progress updates aren't sent.
- Delivery outcome: sending an actionable message tells the sender what happened to it.
Acceptance criteria
- Before any tool changes, the PR lists every caller of
j5_spawn_agent,delegate_task,j5_propose_crew,j5_request_crew_member, and native subagent guidance. That includes personas, playbooks, scheduled tasks, and the instruction files. Nothing a caller depends on is removed. - The standing instructions present three choices: work directly, subagents for independent assignments, or a Crew for work where workers must respond to each other. Each has one sentence on when to use it. They say the word "crew" in my message doesn't decide the choice, and that an agent may reassess mid-work without restarting completed work.
- The instructions present two ways to get help: create a subagent, or add a Crew member.
j5_spawn_agentis described only for a user's explicit request for a standalone agent. - Each tool description says which of the two paths it serves, and the quoted copies in agent-tools.md change with them.
- The
<crew_collaboration>rules tell members to:- send review findings and fixes directly to the teammate who owns the work;
- repeat until there are no unresolved findings;
- message the Captain only for a review pass, a blocker that names what's needed, or a disagreement they couldn't settle;
- send no acknowledgments or progress updates.
- A review pass names the commit or change it reviewed, so the Captain can tell it refers to the current code.
- A review loop that isn't converging becomes a blocker or a disagreement sent to the Captain, rather than continuing indefinitely. The rules give a plain cutoff (for example, the same finding twice).
- The Captain's guidance says it resolves technical disagreements within the agreed scope itself, and asks me only when product intent or my judgment is needed.
-
j5_send_messagereturns a delivery outcome for each recipient: steered into a running turn, queued for the next turn, starting the recipient's turn, waiting for an offline recipient, or refused with the reason. The outcome is typed in contracts. - Steering is checked on Codex, Claude, and Cursor in a live test, covering messages to a busy run, Stop during a steered turn, and a message that arrives after the run ends. crews.md states the result per provider. Where Cursor can't steer without changing upstream's adapter, it's recorded as "not supported here".
- Focused tests cover the delivery outcome for steered, queued, and offline recipients, and the instruction tests pin the new wording.
- crews.md (communication and steering prose, AC9, AC16) and agent-tools.md are rewritten for the two paths and the new member rules.
Out of scope
- Removing
j5_spawn_agentordelegate_task. This issue changes guidance and descriptions; deleting a tool needs its own issue once the inventory shows nothing depends on it. - Taking over a subagent as a standalone agent.
- Captain-to-Captain coordination, file locking, or a dependency scheduler.
- Measuring message volume. That follows once this has been used for a while.
Activity
14 remaining items
feat(j5): agents choose between subagents and Crew members from conte…