Repository navigation
Description
Item 9 of 11 in the Personas v2: simpler specialists milestone.
The problem
Sometimes a Crew member should be on a different model. The common case is a reviewer whose model just wrote the new work it's about to review. The Captain can add a new member with j5_request_crew_member. But the new member can't take over the old member's Playbook steps, because a step has exactly one owner and an addition can only claim unowned steps. So you end up with two members and the old one still owns the work.
Where this sits
This is decision 4 of the Personas v2 proposal. It was tightened by Bastian's comment "Define how replacement transfers work". People switch models directly (#783). This story is how agents and Captains do it.
What we already have
- Step ownership:
apps/server/src/j5/a2a/AgentCrewInstanceService.ts:210-225(stepOwnershipConflict) enforces that a step has one owner. - Additions:
j5_request_crew_member(apps/server/src/j5/a2a/mcp/tools.ts:587) adds a seat without approval (Crews: Agent Setup, auto-approve new Crews, and additions without approval #743). On a Playbook Crew, its steps can only claim unowned step ids.CrewRuntimeRequestService.tshandles the request. - Re-delivery:
j5_playbook_backandj5_playbook_reselect(apps/server/src/j5/playbooks/mcp.ts:100-107,PlaybookStore.ts) already hand a step to its owner again. - Stopping:
j5_stop_agentandCrewStopService.tsstop a member and leave its thread readable.
Proposal
The Captain's addition request can name a seat it replaces. When the new member launches:
- Steps move. The replaced seat's unfinished Playbook steps move to the new member. Ownership moves, it isn't shared, so every step still has one owner.
- Already-delivered steps. If a step was already handed to the old seat, the Playbook hands it to the new owner again, the same way
j5_playbook_backandj5_playbook_reselectre-deliver a step. - The original stops. The original member is stopped. Its thread, model, and history stay readable, and finished steps keep their record.
- Failure moves nothing. If the new member fails to launch, nothing moves and the original keeps its steps.
The new member goes through the same checks as any agent pick (#781), and for a flagged reviewer, the same model preference (#782). No human approval is needed, same as other additions.
Acceptance criteria
-
j5_request_crew_memberaccepts an optional seat to replace. The tool description explains when to use it. - Naming a seat that doesn't exist, or the Captain's own seat, is refused with a reason.
- On a successful launch, the replaced seat's unfinished steps belong to the new member, and no step has two owners.
- A step that was already delivered to the old seat is delivered to the new owner through the existing re-delivery path.
- The original member is stopped. Its thread stays readable, and finished steps keep their record.
- If the new member fails to launch, nothing moves and the original keeps its steps and keeps running.
- The new member is held to Personas: agents pick personas, and who picked sets the limits #781's limits, and to Personas: reviewers prefer a different model from the author #782's preference if it's a flagged reviewer.
- The Fleet row and the Captain's expander show the replaced member as stopped and the new member in its place.
-
docs/j5/product/features/crews.mddescribes replacement. - Focused tests cover: a replacement taking over unfinished steps; re-delivery of a step already handed out; a failed launch moving nothing; and a refused replacement naming a missing seat.
Out of scope
- A person replacing a member through the UI. People switch models directly (Personas: people can switch a persona worker's model #783).
- Replacing a member that isn't on a Playbook Crew needs no step handling. It's just an addition plus a stop, and it works the same way.
Activity
docs(j5): persona History keeps #784, and mobile's Inbox lists asks
feat(j5): agents draft persona edits, and the Owner saves them (#938)