diff --git a/FORK.md b/FORK.md index 0c589dc17fd14..8b844153ab48f 100644 --- a/FORK.md +++ b/FORK.md @@ -96,13 +96,13 @@ Against upstream pin `d2c440312e5f39d59827ed466838a623516454d6`, the inventory h 7. J5's user-message seam (the A2A timeline design of 2026-10-24, register D38, which replaced D16 and retired the A2A cards): `apps/web/src/components/chat/TimelineUserMessageRow.tsx` imports J5-owned `renderThreadA2ADelivery`, `useJ5UserMessagePresentation` and `J5MessageAuthorLine` from `apps/web/src/j5/a2a/ThreadA2ARenderer.tsx`. `UserMessageRow` first calls `renderThreadA2ADelivery` with upstream's `formatDayAwareTimestamp` label and the participant labels, thread and markdown folder from `TimelineRowCtx` (case 24), and returns its answer when it is not null: J5's platform notices, which are Crew notices, a shared conversation's note (case 80), silence lines, and the raw card for a platform delivery no parser reads yet, kept until [#698](https://github.com/Jacksondr5/j5code/issues/698). In `UserTimelineRow`, `useJ5UserMessagePresentation(row.message)` replaces upstream's `resolveUserMessagePresentation`. It returns upstream's shape with the words without J5's envelope as `text`, and `"agent"` as the attribution of every participant who is not a person, so upstream's fold applies to agents, machine participants, outside agents, peers and spawn briefs; it adds `j5`, `literalContext`, `authorName`, `side` and `preview`. `resolvedContext` reads `userMessage.literalContext ?? resolveUserMessageContext(row.message)`, so a spawn brief's context is taken as written. The row is `items-start` when `userMessage.side === "left"`, as it already is for case 80's `sharedAuthor`. Case 80's author slot is ``: "You · via Inbox", another person's name with "· via Inbox", the participant identity line with its Exchange badge or tag, or else case 80's `SharedMessageAuthorLine`. The expanded row's footer shows J5-owned `J5OpenSenderThread` (the sender's resolved scoped thread, so a spawn brief or a peer's message gets Open thread) ahead of upstream's `senderThreadId` button. `MessageAuthorHeading` reads `sharedAuthor?.name ?? userMessage.authorName ?? "You"`. `FoldedMessageHeader` gets an empty `label` for a message J5 read (the name is on the identity line) and renders its label span only when the label is not empty; its `summary` is `userMessage.preview ?? foldSummary`. Classification and every envelope parser are J5-owned `packages/client-runtime/src/j5/userMessagePresentation.ts` and `crewNotices.ts`, so web and mobile share one parser, reached through the `./j5/user-message` and `./j5/crew-notices` exports this case appends to upstream-owned `packages/client-runtime/package.json`; `userMessagePresentation.test.ts` is the proof. Upstream's `MessagesTimeline.browser.test.tsx` mocks `useJ5UserMessagePresentation` with upstream's own presentation, because its tests cover upstream's row. Upstream's own thread sends, which carry no J5 envelope, are group 3 too: on the left, named from the sender thread's title. Groups 4 and 5 of the design (J5's notices as grey lines, and J5's look for upstream's platform prompts and Automation row) are not built yet ([#698](https://github.com/Jacksondr5/j5code/issues/698)). On a pin advance: if upstream reshapes the user row or its fold, keep the presentation swap, the context swap, the author slot, the side and the preview. 8. A2's provider steering seam. J5's standing instructions for agents live in J5-owned `packages/provider-core/src/j5/`: `orchestrationInstructions.ts` holds the text as sections of under 4,000 bytes each (`J5_ORCHESTRATION_SECTIONS`, joined as `J5_ORCHESTRATION_INSTRUCTIONS`), built from `agentInvocationInstructions.ts` (persona mentions) and `playbookInstructions.ts` (case 45). Upstream keeps its own text and helpers in `packages/provider-core/src/server/orchestrationInstructions.ts`. J5's one logic edit there (Jackson, 2026-10-09; on the sections since the 2026-10-24 advance, when upstream split its text into them) replaces upstream's literal sections with `export const T3_CODE_ORCHESTRATION_SECTIONS: ReadonlyArray = J5_ORCHESTRATION_SECTIONS`, and upstream's own line joins them into `T3_CODE_ORCHESTRATION_INSTRUCTIONS`, so upstream's helpers in that file and every consumer of either constant carry J5's text: Codex, Claude, Cursor, both OpenCode adapters, the ACP adapter, Pi's extension (`packages/provider-pi/src/server/mcpExtensionSource.ts`), and any provider upstream moves into a package later. Upstream's literal is deleted, not kept beside the alias, so an upstream edit to it conflicts in the merge instead of landing unseen in unused text. Since the advance onto stable v0.1.3 the file has a second alias of the same kind: `T3_CODE_ACP_MCP_FALLBACK_INSTRUCTIONS`, the terminal fallback upstream sends only to ACP harnesses, is J5-owned `J5_ACP_MCP_FALLBACK_INSTRUCTIONS`, which names the J5 tools and keeps the Peer Agent and Exchange rules in force over that transport. The file's other J5 edits are branding strings: the "J5 Code browser" heading and the ACP mode text. `Adapters/ClaudeAdapterV2.ts` and the package adapters (`packages/provider-acp/src/server/adapter.ts`, `packages/provider-cursor/src/server/adapter.ts`, and `packages/provider-opencode/src/server/adapter.ts` and `v2/adapter.ts`) import the package as upstream wrote them and carry no edit for this case. The package's `exports` map is unchanged, because nothing outside the package imports `src/j5`. A rebase that restores upstream's literal is a protected-seam regression. - What the text says. It replaces upstream's delegated-task steering with three shapes of help: a Subagent the provider runs, a Peer Agent created with platform `j5_spawn_agent`, and a Crew proposed with `j5_propose_crew` (2026-09-17, Jackson's proposal on PR #148, so an agent asked for a crew reaches `j5_propose_crew` instead of the nearest thing it was told about). The spawn brief itself states the task and whether and what reply is expected. A follow-up `j5_send_message(..., expect_reply=true, intent="...")` opens an Exchange only for later work owed by an existing participant; it is never the second half of a spawn sequence. A requested Crew must go through `j5_propose_crew` and human roster approval, with no substitution of native Subagents, `delegate_task`, or individual `j5_spawn_agent` calls. The text covers custom members, direct collaboration, and inbox approval for additions. The Crew bullet says custom seats take the Captain's harness, model, and reasoning but run with full access unless `runtime_mode` is set (#326). The ratified SP4 brief sentence lives exactly once, in the J5 `j5_spawn_agent` Tool description; the steering restates the contract without duplicating that sentence. + What the text says. It replaces upstream's delegated-task steering with three ways of working and two ways to get help (Bryant, 2026-10-27, #746; Jackson, 2026-10-31, kept an explicit request as the trigger). An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism, and a requested crew goes through `j5_propose_crew` (the 2026-09-17 rule from Jackson's proposal on PR #148); a word mentioned in passing or in quoted text is not a request. When the person asked for none, the agent chooses from the work: work directly; use subagents for independent assignments; use a Crew for work whose workers must respond to each other. It may reassess mid-work without restarting completed work. Help comes two ways: create a subagent (the provider's native tool, or `delegate_task` across providers), or put members on a Crew (`j5_propose_crew` starts one, `j5_request_crew_member` grows one). `j5_spawn_agent` is described for a user's explicit request for a Peer Agent or standalone agent and for callers that already use it, and as not a way to get help when nobody asked; the spawn brief itself states the task and whether and what reply is expected. A follow-up `j5_send_message(..., expect_reply=true, intent="...")` opens an Exchange only for later work owed by an existing participant; it is never the second half of a spawn sequence. A Crew chosen but unavailable through `j5_propose_crew` is reported, not replaced by other agents. The text covers custom members, members' own review loops (findings go straight to the teammate who owns the work, the Captain hears only a review pass, a blocker, an unsettled disagreement, or the member's final result or step report), and direct additions with `j5_request_crew_member`. The same rules reach members through the `` block in J5-owned `apps/server/src/j5/a2a/spawnIds.ts`, and each tool description names the path it serves. No edit to the upstream file beyond the existing alias is needed for any of this. The Crew bullet says custom seats take the Captain's harness, model, and reasoning but run with full access unless `runtime_mode` is set (#326). The ratified SP4 brief sentence lives exactly once, in the J5 `j5_spawn_agent` Tool description; the steering restates the contract without duplicating that sentence. What it takes from upstream (Jackson's 2026-10-08 decision 8), as upstream wrote it. At v0.1.3 upstream cut its instructions and tool copy by 60% (pingdotgg/t3code#24850), and J5's text was rewritten onto the shorter rules, seven sections, each under 4,000 bytes. From upstream: the `request_secret` bullet, `t3-thread://v1/` thread links, the "Visuals and preview" section with its rule never to use `preview_*` to verify or show one's own edit, the browser section (headed "J5 Code browser"), the rule to schedule without running the prompt, and the `delegate_task` rules. Those are: use `delegate_task` for another provider's model, for same-provider work when the native subagent tool cannot run the chosen model (the native tool's model list is not the full list; pass `search` to `orchestrator_capabilities`, pingdotgg/t3code#22889), for user-asked settings, for a separate checkout (`isolation:"worktree"`), or for background work; make one new `delegate_task` call per review round, carrying the prior findings; follow a running delegate's `next` and end the turn rather than poll it (`task_status`), and stop one that is no longer needed with `task_cancel` (pingdotgg/t3code#24887). Upstream's whole schedules bullet, which J5 carried since decision 8, is gone, because upstream moved it into the tool's description. Upstream's runtime text, which tells delegated children not to watch pull requests, is taken as upstream ships it. The model-options rule follows upstream's v0.1.3 wording, which relaxed it: a native subagent is right when the child needs "no settings beyond yours", and only settings the user asked for send a child through `delegate_task`. That replaces the stricter rule of 2026-10-24 (Jackson's decision 7 of that day, pingdotgg/t3code#16595), under which a child that kept the parent's model with options it inherited also went through `delegate_task`. That bullet is gone: decision 7 was to take upstream's rule whole, so J5 takes the relaxed one too. J5's `delegate_task` description (`J5_DELEGATE_TASK_DESCRIPTION` in `apps/server/src/j5/agents/agentDelegation.ts`) is J5's persona rules followed by upstream's short text; upstream's mechanics (isolation, the wait mode and its blocking question, `runtimeMode`, `target.options`, option inheritance) are now in the descriptions of the input fields, which J5 reuses from upstream's schema unchanged. J5's `orchestrator_capabilities` (`orchestratorSurface.ts`) passes upstream's per-provider `runtimeModes` through and takes upstream's option shape, its `search` input and its `inheritedOptions` and `omittedModels` results; its description and `t3_attachment_prepare_upload`'s were shortened with upstream's. Upstream's clause about `t3_thread_send` is dropped. Upstream's standalone-executable ACP fallback (`T3_ACP_MCP_ENTRYPOINT`, entrypoint optional) is ported, through the second alias above, without upstream's `delegate_task` example, which would point an ACP agent at a delegated child before J5's three shapes of help. Upstream's `t3_thread_launch` / `create_threads` / workspace-strategy guidance is deliberately not. Codex. Codex carries application instructions in `turn/start.additionalContext`, in both Default and Plan mode. Upstream's `buildCodexAdditionalContext` (`apps/server/src/provider/CodexDeveloperInstructions.ts`) sends `T3_CODE_ORCHESTRATION_SECTIONS` one section per entry, because Codex cuts the middle out of an entry over 4,000 bytes (`CODEX_ADDITIONAL_CONTEXT_VALUE_MAX_BYTES`), so J5's sections reach Codex through upstream's code and each must stay under that size. J5's edit to that file for this case, a spread of its own splitter, retired at the 2026-10-24 advance; the file's one J5 edit left is a branding string. J5-owned `apps/server/src/j5/codexApplicationContext.ts` now splits only persona text, which `CodexAdapterV2.ts` sends as `j5_agent_persona` keys (Role library table). - Proof. `packages/provider-core/src/j5/orchestrationInstructions.test.ts` asserts that upstream's constants carry J5's text, that each section fits one Codex entry, and pins the wording: `steers to provider-native Subagents and platform Peer Agents` guards against restoring spawn-then-ask prose and pins the Crew bullet and its full-access clause, and further tests pin the ported upstream sections, the model-option and model search rules included. `apps/server/src/j5/codexOrchestrationInstructions.test.ts` checks that Codex receives J5's sections, in order, and `apps/server/src/j5/codexApplicationContext.test.ts` pins the persona key split. One J5 test added to upstream's `packages/provider-pi/src/server/mcpExtensionSource.test.ts` runs the generated extension and checks that Pi's system prompt names `j5_propose_crew` and none of `t3_thread_launch`, `create_threads` or `t3_thread_wait`. Upstream deleted its own `packages/provider-core/src/server/orchestrationInstructions.test.ts` at the 2026-10-24 advance (pingdotgg/t3code#22557), with the assertions J5 had removed from it. The composed-prompt assertions in `Adapters/CodexAdapterV2.test.ts` and `ClaudeAdapterV2.test.ts` compare against the package's `T3_CODE_ORCHESTRATION_INSTRUCTIONS` rather than pinning product wording, so an authorized wording change needs no adapter-test edit. At every advance, diff upstream's package file against the previous pin and port new sections into J5's text; upstream's helper changes arrive through the merge. + Proof. `packages/provider-core/src/j5/orchestrationInstructions.test.ts` asserts that upstream's constants carry J5's text, that each section fits one Codex entry, and pins the wording: `honors an explicit request for a Crew, Peer Agent or subagent, and lets the work decide otherwise` pins both halves of the rule, `keeps j5_spawn_agent for a Peer Agent the person asked for` guards against restoring spawn-then-ask prose and pins the Crew bullet and its full-access clause, one test pins the member review-loop and Captain rules, and further tests pin the ported upstream sections, the model-option and model search rules included. `apps/server/src/j5/codexOrchestrationInstructions.test.ts` checks that Codex receives J5's sections, in order, and `apps/server/src/j5/codexApplicationContext.test.ts` pins the persona key split. One J5 test added to upstream's `packages/provider-pi/src/server/mcpExtensionSource.test.ts` runs the generated extension and checks that Pi's system prompt names `j5_propose_crew` and none of `t3_thread_launch`, `create_threads` or `t3_thread_wait`. Upstream deleted its own `packages/provider-core/src/server/orchestrationInstructions.test.ts` at the 2026-10-24 advance (pingdotgg/t3code#22557), with the assertions J5 had removed from it. The composed-prompt assertions in `Adapters/CodexAdapterV2.test.ts` and `ClaudeAdapterV2.test.ts` compare against the package's `T3_CODE_ORCHESTRATION_INSTRUCTIONS` rather than pinning product wording, so an authorized wording change needs no adapter-test edit. At every advance, diff upstream's package file against the previous pin and port new sections into J5's text; upstream's helper changes arrive through the merge. 9. The authenticated J5 route aggregate: in `apps/server/src/server.ts`, `j5AuthenticatedRoutesLayer` is the one J5 entry in `layerMakeRoutes`, after upstream's `Ws.layer`, and the core J5 creation layer is provided once to the V2 runtime. The J5-owned aggregate in `apps/server/src/j5/a2a/J5AuthenticatedRoutes.ts` composes the client reads (human inbox, Crew, Fleet, playbooks, artifacts, the peer list) with the routes another server, a script or the `j5` CLI calls (peer, machine-sender). What a person does from a client is not a route: those are WebSocket RPCs (case 64). Future J5 authenticated route layers enter through this aggregate, never through another `server.ts` entry. Since the ledger re-keyed to projects ([#412](https://github.com/Jacksondr5/j5code/issues/412)) the aggregate has no Squadron routes: the list, create, rename, delete, assign-imported and thread-home routes are removed, and `apps/web/src/j5/squadron/` is deleted. On every rebase, verify the single server entry still follows `Ws.layer`. 10. Retired 2026-10-07 (the ledger re-keys to projects, [#412](https://github.com/Jacksondr5/j5code/issues/412)): the `squadronId` launch carrier is removed from `packages/contracts/src/orchestrationV2.ts`, `packages/client-runtime/src/operations/commands.ts` (with `SquadronLaunchRequiresBootstrapError`), `apps/server/src/ws.ts` and `apps/server/src/orchestration-v2/ThreadLaunchService.ts`, which no longer registers anything; its `register-squadron` operation and the J5 registration tests in `ThreadLaunchService.test.ts` went with it. A thread's home is its project, so nothing is carried. Registration moved off the launch path to the one place every creation reaches: J5-owned `apps/server/src/j5/a2a/LifecycleService.ts` handles the stored `thread.created` event and calls J5-owned `ThreadRegistration.ts`. That covers the two importers that write `thread.created` straight to the event sink (`project/AgentSessionImporter.ts`, `orchestration-v2/legacy/LegacyV1ThreadImporter.ts`) without an edit to either, and it skips a thread whose lineage says `subagent`. At start the same service registers every existing thread that should be a participant and is not one. No upstream file is edited for registration. diff --git a/apps/server/src/j5/a2a/crewGateNotice.test.ts b/apps/server/src/j5/a2a/crewGateNotice.test.ts index 2ab1020544d54..4a4c3c4a715e2 100644 --- a/apps/server/src/j5/a2a/crewGateNotice.test.ts +++ b/apps/server/src/j5/a2a/crewGateNotice.test.ts @@ -282,6 +282,10 @@ describe("crew launch report", () => { "launch: 2 started, 0 failed, 0 not created, 0 start unconfirmed after 60s", ); assert.include(text, "Your crew is running."); + assert.include( + text, + "resolve technical disagreements within the agreed scope yourself, and ask the user only when product intent or their judgment is needed", + ); assert.notInclude(text, "seat_failed"); }); it("identifies automatic approval without attributing it to a person", () => { diff --git a/apps/server/src/j5/a2a/crewGateNotice.ts b/apps/server/src/j5/a2a/crewGateNotice.ts index f7615109ad222..63d67a7c31f93 100644 --- a/apps/server/src/j5/a2a/crewGateNotice.ts +++ b/apps/server/src/j5/a2a/crewGateNotice.ts @@ -218,7 +218,7 @@ export const crewLaunchReportText = (input: { `This Crew follows playbook ${playbook.name}. Start it with j5_playbook_start(name: "${playbook.name}", client_request_id, crew_instance_id: "${instance.id}"). The platform hands each step to the seat that owns it; unowned steps are yours.`, ); prose.push( - "Seats are told to message you with their results; do not ask for the same results again. End your turn and read them as they arrive.", + "Seats are told to message you with their results; do not ask for the same results again. Members run their own review loops and message you only for a review pass, a blocker, a disagreement they could not settle, or their final result or step report: you resolve technical disagreements within the agreed scope yourself, and ask the user only when product intent or their judgment is needed. End your turn and read their messages as they arrive.", ); return `${block}\n\n${prose.join(" ")}`; }; diff --git a/apps/server/src/j5/a2a/mcp/tools.test.ts b/apps/server/src/j5/a2a/mcp/tools.test.ts index 87bf64443cf15..f57e7eb52d2e4 100644 --- a/apps/server/src/j5/a2a/mcp/tools.test.ts +++ b/apps/server/src/j5/a2a/mcp/tools.test.ts @@ -7,6 +7,7 @@ import * as FileSystem from "effect/FileSystem"; import * as Schema from "effect/Schema"; import { Tool } from "effect/ai"; +import { J5DelegateTaskTool } from "../../agents/agentDelegation.ts"; import { A2A_SEND_TOOL_DESCRIPTION } from "../EnvelopeFormatter.ts"; import { J5AttachmentUploadToolkit } from "./attachments.ts"; import { J5AdaptedThreadToolkit } from "./threadTools.ts"; @@ -260,6 +261,21 @@ it("refuses a blank spawn title and stores it trimmed", () => { assert.equal(decodeSpawnAgent({ ...spawn, title: " Login fixer " }).title, "Login fixer"); }); +it("says which of the two ways to get help each tool serves", () => { + // j5_spawn_agent serves neither: it is for a Peer Agent the user asked for. + assert.include(J5_SPAWN_AGENT_DESCRIPTION, "explicitly asks for a Peer Agent"); + assert.include( + J5_SPAWN_AGENT_DESCRIPTION, + "When nobody asked for one, it is not a way to get help with your own work", + ); + assert.include(J5_SPAWN_AGENT_DESCRIPTION, "create a subagent"); + assert.include(J5_PROPOSE_CREW_DESCRIPTION, "the second of the two ways to get help"); + assert.include(J5_PROPOSE_CREW_DESCRIPTION, "Use it when the user asks for a crew"); + assert.notInclude(J5_PROPOSE_CREW_DESCRIPTION, "does not decide it"); + assert.include(J5_REQUEST_CREW_MEMBER_DESCRIPTION, "the second of the two ways to get help"); + assert.include(J5DelegateTaskTool.description, "the first of the two ways to get help"); +}); + it("tells a Captain proposing a crew how a playbook shapes the roster", () => { assert.include(J5_PROPOSE_CREW_DESCRIPTION, "For a crew built from a playbook"); }); diff --git a/apps/server/src/j5/a2a/mcp/tools.ts b/apps/server/src/j5/a2a/mcp/tools.ts index 4ac5400c31e2b..f73b4c0d625e5 100644 --- a/apps/server/src/j5/a2a/mcp/tools.ts +++ b/apps/server/src/j5/a2a/mcp/tools.ts @@ -576,16 +576,16 @@ export const J5ArchiveCrewFailure = Schema.Struct({ export type J5ArchiveCrewFailure = typeof J5ArchiveCrewFailure.Type; export const J5_SPAWN_AGENT_DESCRIPTION = - "Spawn a Peer Agent: a full-citizen teammate with its own top-level thread, starting on your brief as its first turn. It joins your project unless you name another with project_id or set scratch for none, and records you as its immutable spawner; in your own project it is placed under you. It is addressable the moment this returns. In your brief, tell the new agent what it should do first and whether it should reply to you. Choose provider, model, and reasoning for the work in the brief; see orchestrator_capabilities for what's available. To run a persona from j5_list_personas, set `persona` to its id: the spawn gets that persona's instructions and runtime policy, and provider, model, and reasoning must be one of that persona's declared routes. Without a persona it runs in your permission and interaction modes, or in narrower ones you set with runtime_mode and interaction_mode. Without a persona its model and reasoning level must be ones the project's Models for custom members lists allow; an ineligible one is refused with the eligible ones. Attach files to the brief with attachments. Choose its workspace every time (see the workspace field). A new worktree is prepared after this returns, and the agent begins once it is bound, possibly while the project's setup script is still running; if preparing it fails, the agent's thread shows why, and it is not retried. Reuse client_request_id to retry the same spawn safely; reusing it with any change to the request is refused, so use a fresh one for new work."; + "Use this when the user explicitly asks for a Peer Agent or a standalone agent they will talk to, or when an outside agent or a skill you are following names it. When nobody asked for one, it is not a way to get help with your own work: create a subagent (your native Subagent tool, or delegate_task) or put members on a Crew (j5_propose_crew). Spawn a Peer Agent: a full-citizen teammate with its own top-level thread, starting on your brief as its first turn. It joins your project unless you name another with project_id or set scratch for none, and records you as its immutable spawner; in your own project it is placed under you. It is addressable the moment this returns. In your brief, tell the new agent what it should do first and whether it should reply to you. Choose provider, model, and reasoning for the work in the brief; see orchestrator_capabilities for what's available. To run a persona from j5_list_personas, set `persona` to its id: the spawn gets that persona's instructions and runtime policy, and provider, model, and reasoning must be one of that persona's declared routes. Without a persona it runs in your permission and interaction modes, or in narrower ones you set with runtime_mode and interaction_mode. Without a persona its model and reasoning level must be ones the project's Models for custom members lists allow; an ineligible one is refused with the eligible ones. Attach files to the brief with attachments. Choose its workspace every time (see the workspace field). A new worktree is prepared after this returns, and the agent begins once it is bound, possibly while the project's setup script is still running; if preparing it fails, the agent's thread shows why, and it is not retried. Reuse client_request_id to retry the same spawn safely; reusing it with any change to the request is refused, so use a fresh one for new work."; const J5_LIST_AGENTS_DESCRIPTION = - "List the personas in this environment: id, purpose, runtime policy, whether each can start now, and the provider, model, and reasoning it would run on. Read this before choosing a persona for j5_spawn_agent or a crew roster so the choice fits the task and the user's budget. Read-only."; + "List the personas in this environment: id, purpose, runtime policy, whether each can start now, and the provider, model, and reasoning it would run on. Read this before choosing a persona for delegate_task, a crew roster, or j5_spawn_agent so the choice fits the task and the user's budget. Read-only."; export const J5_PROPOSE_CREW_DESCRIPTION = - "Propose the crew you need for the brief you were given. Use it when the user asks for a crew or the work splits into distinct responsibilities that should run at once. Mix saved personas and custom seats in the same roster: call j5_list_personas when choosing a saved persona, or leave persona unset for a custom seat with its own instructions (required) and the brief. Custom seats inherit your harness, model, and reasoning by default and run with full-access unless you set runtime_mode; to choose different ones, set model_selection (instanceId, model, options) and/or runtime_mode using orchestrator_capabilities. A custom seat's model and reasoning level, yours included, must be ones the project's Models for custom members lists allow; an ineligible one is refused with the eligible ones. Saved personas are proposed with their own configuration; only the human may override their runtime before approval. To have the crew follow a playbook, set playbook to a name from j5_playbook_list and give seats the step ids they own (steps, from j5_playbook_read); a step has one owner, steps no seat owns are yours as Captain, and the result reports unowned steps and any step whose persona differs from its seat's. For a crew built from a playbook, staff one seat per distinct persona its steps name, each owning that persona's steps, and propose a custom seat, noted in its reason, where a named persona isn't available. Every seat names its workspace, with the same three choices as j5_spawn_agent. Name the crew for what it is for and give each seat a short lowercase-hyphen name like code-reviewer. By default the user reviews and edits the roster in this thread, then approves or declines. If Auto-approve new Crews is on for your project, the proposed roster is created immediately with no approval card. The result says whether it is open or approved; the launch report arrives here once creation finishes or fails. Approval creates seats without starting turns. Send each member its first assignment when it has work; reuse finished members for follow-up work in the same thread. Each seat keeps its configured access and tool approvals, which may exceed yours. You become the crew's Captain and may command several crews at once; later requests, stops, and archives name the crew they mean. Use j5_send_message for member-to-member, member-to-Captain, and Captain-to-Captain coordination, including findings and direct results; artifacts do not gate these conversations. Reuse client_request_id to retry safely; a changed request is refused, so use a fresh one for new work. This tool works under every sandbox and approval policy, including approval policy never; never refuse the brief because approvals are disabled."; + "Put members on a Crew, the second of the two ways to get help (the first is a subagent). Propose the crew you need for the brief you were given. Use it when the user asks for a crew, or when the work needs workers who must respond to each other, such as a builder and reviewers iterating on a change; independent assignments go to subagents instead. Mix saved personas and custom seats in the same roster: call j5_list_personas when choosing a saved persona, or leave persona unset for a custom seat with its own instructions (required) and the brief. Custom seats inherit your harness, model, and reasoning by default and run with full-access unless you set runtime_mode; to choose different ones, set model_selection (instanceId, model, options) and/or runtime_mode using orchestrator_capabilities. A custom seat's model and reasoning level, yours included, must be ones the project's Models for custom members lists allow; an ineligible one is refused with the eligible ones. Saved personas are proposed with their own configuration; only the human may override their runtime before approval. To have the crew follow a playbook, set playbook to a name from j5_playbook_list and give seats the step ids they own (steps, from j5_playbook_read); a step has one owner, steps no seat owns are yours as Captain, and the result reports unowned steps and any step whose persona differs from its seat's. For a crew built from a playbook, staff one seat per distinct persona its steps name, each owning that persona's steps, and propose a custom seat, noted in its reason, where a named persona isn't available. Every seat names its workspace, with the same three choices as j5_spawn_agent. Name the crew for what it is for and give each seat a short lowercase-hyphen name like code-reviewer. By default the user reviews and edits the roster in this thread, then approves or declines. If Auto-approve new Crews is on for your project, the proposed roster is created immediately with no approval card. The result says whether it is open or approved; the launch report arrives here once creation finishes or fails. Approval creates seats without starting turns. Send each member its first assignment when it has work; reuse finished members for follow-up work in the same thread. Each seat keeps its configured access and tool approvals, which may exceed yours. You become the crew's Captain and may command several crews at once; later requests, stops, and archives name the crew they mean. Use j5_send_message for member-to-member, member-to-Captain, and Captain-to-Captain coordination, including findings and direct results; artifacts do not gate these conversations. Members run their own review loops and message you only for a review pass, a blocker, a disagreement they could not settle, or their final result or step report; you resolve technical disagreements within the agreed scope and ask the user only when product intent or their judgment is needed. Reuse client_request_id to retry safely; a changed request is refused, so use a fresh one for new work. This tool works under every sandbox and approval policy, including approval policy never; never refuse the brief because approvals are disabled."; export const J5_REQUEST_CREW_MEMBER_DESCRIPTION = - "Add one seat directly to a running crew you command when the work needs expertise the roster lacks. No human approval is needed, regardless of Auto-approve new Crews. Give a seat name, a persona id from j5_list_personas or required instructions for a custom seat, a reason identifying the missing expertise, and its workspace (the same choices as j5_propose_crew). Custom seats inherit your model selection and run with full-access unless you set model_selection or runtime_mode; a custom seat's model and reasoning level must be ones the project's Models for custom members lists allow, and saved personas use their own configuration. Optionally give a brief; otherwise the seat gets the Crew's brief. On a playbook Crew, steps may claim only unowned step ids from j5_playbook_read. The result returns the updated roster or refuses the seat with its name and reason; creation is reported separately here. The new member waits for its first assignment; send it with j5_send_message when the work is ready. Each member's configured access still controls tool approvals. Captain-only: a member sends the concern to its Captain with j5_send_message. Reuse client_request_id to retry safely; a changed request is refused, so use a fresh one for new work. Works under every approval policy, including approval policy never."; + "Put one more member on a Crew, the second of the two ways to get help: add one seat directly to a running crew you command when the work needs expertise the roster lacks. No human approval is needed, regardless of Auto-approve new Crews. Give a seat name, a persona id from j5_list_personas or required instructions for a custom seat, a reason identifying the missing expertise, and its workspace (the same choices as j5_propose_crew). Custom seats inherit your model selection and run with full-access unless you set model_selection or runtime_mode; a custom seat's model and reasoning level must be ones the project's Models for custom members lists allow, and saved personas use their own configuration. Optionally give a brief; otherwise the seat gets the Crew's brief. On a playbook Crew, steps may claim only unowned step ids from j5_playbook_read. The result returns the updated roster or refuses the seat with its name and reason; creation is reported separately here. The new member waits for its first assignment; send it with j5_send_message when the work is ready. Each member's configured access still controls tool approvals. Captain-only: a member sends the concern to its Captain with j5_send_message. Reuse client_request_id to retry safely; a changed request is refused, so use a fresh one for new work. Works under every approval policy, including approval policy never."; export const J5_STOP_AGENT_DESCRIPTION = "Stop one Peer Agent the way a user Stop does: its running turn is interrupted now, turns already queued behind it, messages you sent it included, are held until a person resumes its queue or the next message reaches it (that message resumes the queue and runs after them, in order), its pull request watches end, and the tasks it delegated stop too. The agent remains, stays readable, and can be messaged again later: stopping halts work, it retires nothing. It reaches any agent on this server, in any project. Reuse client_request_id to retry safely."; diff --git a/apps/server/src/j5/a2a/spawnIds.test.ts b/apps/server/src/j5/a2a/spawnIds.test.ts index cfa12ed7ff3d7..8405f99657507 100644 --- a/apps/server/src/j5/a2a/spawnIds.test.ts +++ b/apps/server/src/j5/a2a/spawnIds.test.ts @@ -53,6 +53,7 @@ it("gives custom seats direct result and concern reporting without a mandatory a text, "use j5_send_message to coordinate directly with your Captain and other members", ); + assert.notInclude(text, "Share useful findings, evidence, questions, and blockers immediately"); assert.include(text, "final result, supporting evidence, and any remaining blockers"); assert.include(text, "j5_request_crew_member to add the seat directly"); assert.include(text, "Continue your work and coordination"); @@ -62,6 +63,23 @@ it("gives custom seats direct result and concern reporting without a mandatory a assert.notInclude(text, "j5_write_artifact"); }); +it("has members run their own review loops and reach the Captain only for a pass, a blocker or a disagreement", () => { + const text = spawnFirstTurnText({ ...identity, crew }); + assert.include( + text, + "send your findings directly to the teammate who owns it. When you receive findings, fix them and send the fix directly back to the reviewer. Repeat until no finding is unresolved.", + ); + // The cutoff is a fixed count of rounds, not a judgment about whether the loop is converging. + assert.include( + text, + "A round is one message of findings and the fix that answers it; if a loop has not produced a clean pass after three rounds, stop and send it to your Captain as a blocker or a disagreement.", + ); + assert.include( + text, + "Message your Captain only for: a review pass, which names the commit or change you reviewed so the Captain can tell it refers to the current code; a blocker, which names what you need; a disagreement you could not settle with the teammate; or your final result or step report. Send no acknowledgments and no progress updates.", + ); +}); + it("retains declared persona output while allowing conversation before that output exists", () => { const text = spawnFirstTurnText({ ...identity, diff --git a/apps/server/src/j5/a2a/spawnIds.ts b/apps/server/src/j5/a2a/spawnIds.ts index 7133f29de0117..8df077cc33c14 100644 --- a/apps/server/src/j5/a2a/spawnIds.ts +++ b/apps/server/src/j5/a2a/spawnIds.ts @@ -150,7 +150,7 @@ export const spawnFirstTurnText = (input: { crew.seatInstructions === undefined ? [] : [`\n${crew.seatInstructions}\n`]; - const collaboration = `\nResolve current participants with j5_list_participants and use j5_send_message to coordinate directly with your Captain and other members. Share useful findings, evidence, questions, and blockers immediately; do not wait for an artifact or coordination approval. Send your Captain your final result, supporting evidence, and any remaining blockers before finishing. If the roster lacks expertise needed to address a concern, tell your Captain what is missing and why so they can j5_request_crew_member to add the seat directly. Continue your work and coordination while the Captain handles staffing. A direct result is sufficient unless the user or your persona explicitly requires an artifact.\n`; + const collaboration = `\nResolve current participants with j5_list_participants and use j5_send_message to coordinate directly with your Captain and other members; do not wait for an artifact or coordination approval.\nYou run your own review loops. When you review a teammate's work, send your findings directly to the teammate who owns it. When you receive findings, fix them and send the fix directly back to the reviewer. Repeat until no finding is unresolved. A round is one message of findings and the fix that answers it; if a loop has not produced a clean pass after three rounds, stop and send it to your Captain as a blocker or a disagreement.\nMessage your Captain only for: a review pass, which names the commit or change you reviewed so the Captain can tell it refers to the current code; a blocker, which names what you need; a disagreement you could not settle with the teammate; or your final result or step report. Send no acknowledgments and no progress updates. When you finish your assigned work, send your Captain your final result, supporting evidence, and any remaining blockers.\nIf the roster lacks expertise needed to address a concern, tell your Captain what is missing and why so they can j5_request_crew_member to add the seat directly. Continue your work and coordination while the Captain handles staffing. A direct result is sufficient unless the user or your persona explicitly requires an artifact.\n`; // A persona's declared deliverable supplements the conversation; it never gates coordination. const obligation = crew.obligation === undefined diff --git a/apps/server/src/j5/agents/agentDelegation.ts b/apps/server/src/j5/agents/agentDelegation.ts index 3fa5de4098a15..29ccef4bfa059 100644 --- a/apps/server/src/j5/agents/agentDelegation.ts +++ b/apps/server/src/j5/agents/agentDelegation.ts @@ -38,7 +38,7 @@ export type J5DelegateTaskInput = typeof J5DelegateTaskInput.Type; * fallback. */ export const J5_DELEGATE_TASK_DESCRIPTION = - "Start one child agent with only `task`. No parent history. Pass persona=ID when the user writes @persona:ID or asks for a persona by name: the server pins that persona's instructions, provider, model, reasoning, and runtime policy, so omit target and runtimeMode. Give the persona a self-contained task, and if that call fails, report the error instead of substituting a plain child. Without persona, this is a plain J5-tracked child for cross-provider work, for same-provider work the native subagent tool cannot run, or for work the user wants tracked as a J5 task; for an ordinary subagent request, use your provider's native subagent mechanism instead. Without persona the child's model and reasoning level, inherited ones included, must be ones the project's Models for custom members lists allow; a refusal lists the eligible ones to retry with in `target`. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`."; + "Create a subagent, the first of the two ways to get help (the second is a Crew member): start one child agent with only `task`. No parent history. Pass persona=ID when the user writes @persona:ID or asks for a persona by name: the server pins that persona's instructions, provider, model, reasoning, and runtime policy, so omit target and runtimeMode. Give the persona a self-contained task, and if that call fails, report the error instead of substituting a plain child. Without persona, this is a plain J5-tracked child for cross-provider work, for same-provider work the native subagent tool cannot run, or for work the user wants tracked as a J5 task; for an ordinary subagent request, use your provider's native subagent mechanism instead. Without persona the child's model and reasoning level, inherited ones included, must be ones the project's Models for custom members lists allow; a refusal lists the eligible ones to retry with in `target`. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`."; /** J5's delegate_task: the upstream tool with the persona extension, registered in place of it. */ export const J5DelegateTaskTool = Tool.make("delegate_task", { diff --git a/docs/j5/product/a2a/agent-tools.md b/docs/j5/product/a2a/agent-tools.md index 2cc8697b9b861..f5f434fc92494 100644 --- a/docs/j5/product/a2a/agent-tools.md +++ b/docs/j5/product/a2a/agent-tools.md @@ -74,21 +74,27 @@ Read-only; no events. ### `j5_spawn_agent` -**Description (contract):** "Spawn a Peer Agent: a full-citizen teammate with its own top-level -thread, starting on your brief as its first turn. It joins your project unless you name another with -project_id or set scratch for none, and records you as its immutable spawner; in your own project it -is placed under you. It is addressable the moment this returns. In your brief, tell the new agent -what it should do first and whether it should reply to you. Choose provider, model, and reasoning -for the work in the brief; see orchestrator_capabilities for what's available. To run a persona -from j5_list_personas, set `persona` to its id: the spawn gets that persona's instructions and -runtime policy, and provider, model, and reasoning must be one of that persona's declared routes. -Without a persona it runs in your permission and interaction modes, or in narrower ones you set with -runtime_mode and interaction_mode. Without a persona its model and reasoning level must be ones the project's Models for custom members lists allow; an ineligible one is refused with the eligible ones. Attach files to -the brief with attachments. Choose its workspace every time (see the workspace field). A new worktree is prepared after this returns, and the agent -begins once it is bound, possibly while the project's setup script is still running; if preparing it -fails, the agent's thread shows why, and it is not retried. Reuse client_request_id to retry the -same spawn safely; reusing it with any change to the request is refused, so use a fresh one for new -work." +Agents have two ways to get help: a subagent (their provider's own, or `delegate_task`) or members on a Crew (`j5_propose_crew`, `j5_request_crew_member`). `j5_spawn_agent` serves neither. Its description keeps it for a Peer Agent or standalone agent the person explicitly asks for, and for callers that name it, such as an outside agent or a skill; when nobody asked for one it says to use a subagent or a Crew. Nothing a caller depends on was removed. + +**Description (contract):** "Use this when the user explicitly asks for a Peer Agent or a standalone agent they will talk to, or +when an outside agent or a skill you are following names it. When nobody asked for one, it is not a +way to get help with your own work: create a subagent (your native Subagent tool, or delegate_task) +or put members on a Crew (j5_propose_crew). Spawn a Peer Agent: a full-citizen teammate with its own +top-level thread, starting on your brief as its first turn. It joins your project unless you name +another with project_id or set scratch for none, and records you as its immutable spawner; in your +own project it is placed under you. It is addressable the moment this returns. In your brief, tell +the new agent what it should do first and whether it should reply to you. Choose provider, model, +and reasoning for the work in the brief; see orchestrator_capabilities for what's available. To run +a persona from j5_list_personas, set `persona` to its id: the spawn gets that persona's instructions +and runtime policy, and provider, model, and reasoning must be one of that persona's declared +routes. Without a persona it runs in your permission and interaction modes, or in narrower ones you +set with runtime_mode and interaction_mode. Without a persona its model and reasoning level must be +ones the project's Models for custom members lists allow; an ineligible one is refused with the +eligible ones. Attach files to the brief with attachments. Choose its workspace every time (see the +workspace field). A new worktree is prepared after this returns, and the agent begins once it is +bound, possibly while the project's setup script is still running; if preparing it fails, the +agent's thread shows why, and it is not retried. Reuse client_request_id to retry the same spawn +safely; reusing it with any change to the request is refused, so use a fresh one for new work." | Input | Type | Required | Meaning | | ------------------- | ------------------------------------- | -------- | ------------------------------------------------- | @@ -183,9 +189,9 @@ Use `action: "unarchive"` to restore the same identity. Old Exchanges remain clo ### `j5_list_personas` **Description (contract):** "List the personas in this environment: id, purpose, runtime policy, -whether each can start now, and the provider, model, and reasoning it would run on. Read this -before choosing a persona for j5_spawn_agent or a crew roster so the choice fits the task and the -user's budget. Read-only." +whether each can start now, and the provider, model, and reasoning it would run on. Read this before +choosing a persona for delegate_task, a crew roster, or j5_spawn_agent so the choice fits the task +and the user's budget. Read-only." Named `list_agents` until 2026-09-17. No inputs. Result: `personas[]` with `id`, `display_name`, `description`, `runtime_policy`, `availability` (`available`, `blocked`, `disabled`) and `route` (driver · model · reasoning, or @@ -195,32 +201,40 @@ asked for. ### `j5_propose_crew` -**Description (contract):** "Propose the crew you need for the brief you were given. Use it when the user asks for a crew or -the work splits into distinct responsibilities that should run at once. Mix saved personas and -custom seats in the same roster: call j5_list_personas when choosing a saved persona, or leave -persona unset for a custom seat with its own instructions (required) and the brief. Custom seats -inherit your harness, model, and reasoning by default and run with full-access unless you set -runtime_mode; to choose different ones, set model_selection (instanceId, model, options) and/or -runtime_mode using orchestrator_capabilities. A custom seat's model and reasoning level, yours included, must be ones the project's Models for custom members lists allow; an ineligible one is refused with the eligible ones. Saved personas are proposed with their own configuration; only the human may override their runtime before approval. To have the crew follow -a playbook, set playbook to a name from j5_playbook_list and give seats the step ids they own -(steps, from j5_playbook_read); a step has one owner, steps no seat owns are yours as Captain, and -the result reports unowned steps and any step whose persona differs from its seat's. For a crew -built from a playbook, staff one seat per distinct persona its steps name, each owning that -persona's steps, and propose a custom seat, noted in its reason, where a named persona isn't -available. Every seat names its workspace, with the same three choices as j5_spawn_agent. Name the -crew for what it is for and give each seat a short lowercase-hyphen name like code-reviewer. By -default the user reviews and edits the roster in this thread, then approves or declines. If -Auto-approve new Crews is on for your project, the proposed roster is created immediately with no -approval card. The result says whether it is open or approved; the launch report arrives here once -creation finishes or fails. Approval creates seats without starting turns. Send each member its -first assignment when it has work; reuse finished members for follow-up work in the same thread. -Each seat keeps its configured access and tool approvals, which may exceed yours. You become the -crew's Captain and may command several crews at once; later requests, stops, and archives name the -crew they mean. Use j5_send_message for member-to-member, member-to-Captain, and -Captain-to-Captain coordination, including findings and direct results; artifacts do not gate -these conversations. Reuse client_request_id to retry safely; a changed request is refused, so use -a fresh one for new work. This tool works under every sandbox and approval policy, including -approval policy never; never refuse the brief because approvals are disabled." +**Description (contract):** "Put members on a Crew, the second of the two ways to get help (the first is a subagent). Propose the +crew you need for the brief you were given. Use it when the user asks for a crew, or when the work +needs workers who must respond to each other, such as a builder and reviewers iterating on a change; +independent assignments go to subagents instead. Mix saved personas and custom seats in the same +roster: call j5_list_personas when choosing a saved persona, or leave persona unset for a custom +seat with its own instructions (required) and the brief. Custom seats inherit your harness, model, +and reasoning by default and run with full-access unless you set runtime_mode; to choose different +ones, set model_selection (instanceId, model, options) and/or runtime_mode using +orchestrator_capabilities. A custom seat's model and reasoning level, yours included, must be ones +the project's Models for custom members lists allow; an ineligible one is refused with the eligible +ones. Saved personas are proposed with their own configuration; only the human may override their +runtime before approval. To have the crew follow a playbook, set playbook to a name from +j5_playbook_list and give seats the step ids they own (steps, from j5_playbook_read); a step has one +owner, steps no seat owns are yours as Captain, and the result reports unowned steps and any step +whose persona differs from its seat's. For a crew built from a playbook, staff one seat per distinct +persona its steps name, each owning that persona's steps, and propose a custom seat, noted in its +reason, where a named persona isn't available. Every seat names its workspace, with the same three +choices as j5_spawn_agent. Name the crew for what it is for and give each seat a short +lowercase-hyphen name like code-reviewer. By default the user reviews and edits the roster in this +thread, then approves or declines. If Auto-approve new Crews is on for your project, the proposed +roster is created immediately with no approval card. The result says whether it is open or approved; +the launch report arrives here once creation finishes or fails. Approval creates seats without +starting turns. Send each member its first assignment when it has work; reuse finished members for +follow-up work in the same thread. Each seat keeps its configured access and tool approvals, which +may exceed yours. You become the crew's Captain and may command several crews at once; later +requests, stops, and archives name the crew they mean. Use j5_send_message for member-to-member, +member-to-Captain, and Captain-to-Captain coordination, including findings and direct results; +artifacts do not gate these conversations. Members run their own review loops and message you only +for a review pass, a blocker, a disagreement they could not settle, or their final result or step +report; you resolve technical disagreements within the agreed scope and ask the user only when +product intent or their judgment is needed. Reuse client_request_id to retry safely; a changed +request is refused, so use a fresh one for new work. This tool works under every sandbox and +approval policy, including approval policy never; never refuse the brief because approvals are +disabled." Published with `destructiveHint: true`: depending on the project setting, this call can launch agents immediately. @@ -259,19 +273,21 @@ New Crews require human approval by default. **Settings → Agent Setup → Crew ### `j5_request_crew_member` -**Description (contract):** "Add one seat directly to a running crew you command when the work needs expertise the roster -lacks. No human approval is needed, regardless of Auto-approve new Crews. Give a seat name, a -persona id from j5_list_personas or required instructions for a custom seat, a reason identifying -the missing expertise, and its workspace (the same choices as j5_propose_crew). Custom seats -inherit your model selection and run with full-access unless you set model_selection or -runtime_mode; a custom seat's model and reasoning level must be ones the project's Models for custom members lists allow, and saved personas use their own configuration. Optionally give a brief; otherwise the -seat gets the Crew's brief. On a playbook Crew, steps may claim only unowned step ids from -j5_playbook_read. The result returns the updated roster or refuses the seat with its name and -reason; creation is reported separately here. The new member waits for its first assignment; send -it with j5_send_message when the work is ready. Each member's configured access still controls -tool approvals. Captain-only: a member sends the concern to its Captain with j5_send_message. -Reuse client_request_id to retry safely; a changed request is refused, so use a fresh one for new -work. Works under every approval policy, including approval policy never." +**Description (contract):** "Put one more member on a Crew, the second of the two ways to get help: add one seat directly to a +running crew you command when the work needs expertise the roster lacks. No human approval is +needed, regardless of Auto-approve new Crews. Give a seat name, a persona id from j5_list_personas +or required instructions for a custom seat, a reason identifying the missing expertise, and its +workspace (the same choices as j5_propose_crew). Custom seats inherit your model selection and run +with full-access unless you set model_selection or runtime_mode; a custom seat's model and reasoning +level must be ones the project's Models for custom members lists allow, and saved personas use their +own configuration. Optionally give a brief; otherwise the seat gets the Crew's brief. On a playbook +Crew, steps may claim only unowned step ids from j5_playbook_read. The result returns the updated +roster or refuses the seat with its name and reason; creation is reported separately here. The new +member waits for its first assignment; send it with j5_send_message when the work is ready. Each +member's configured access still controls tool approvals. Captain-only: a member sends the concern +to its Captain with j5_send_message. Reuse client_request_id to retry safely; a changed request is +refused, so use a fresh one for new work. Works under every approval policy, including approval +policy never." | Input | Type | Required | Meaning | | --------------------------------- | -------------- | -------- | --------------------------------------------------------------------------- | @@ -390,7 +406,7 @@ run; `j5_stop_crew` doesn't, and unarchiving doesn't restart it. ### Kept upstream tools - `orchestrator_capabilities` — providers and models (ids, labels, option descriptors) for spawn targeting, plus runtime and interaction-mode facts. It deliberately stays silent about delegation even though `delegate_task` is back on the surface: that tool's own description carries its persona use, and J5 verbs are advertised by their own descriptions. -- `delegate_task`, `task_status`, `task_cancel` — upstream's provider-owned child delegation. J5 re-declares `delegate_task` with its own description, which leads with the optional `persona` (a persona id from an `@persona:ID` mention or the Settings → Agent Setup library) and presents the plain child as the fallback for cross-provider or T3-tracked work rather than the default for any subagent request. With `persona`, the server pins that persona's instructions, model route, reasoning, and runtime policy and refuses `target` and `runtimeMode`; without it, the child is upstream's plain subagent, and the model it will run on, one inherited from its parent included, must be one the project's [Models for custom members](../features/crews.md) list allows. J5's wrapper hands upstream's `delegateTask` a hook that is called with that resolved model before anything is created, so the check sees what the child will really run on; a retry of a delegation already accepted is not checked again. A refusal is a `model_unavailable` error naming the model, the project and the setting and listing the eligible models, which the agent passes in `target`; a persona's own model is never checked. Upstream's `isolation: "worktree"` gives a child a checkout of its own, started from the parent's local commit, and the description says so in upstream's words. The child is backing storage under the calling thread, not a Peer Agent; use `j5_spawn_agent` for a participant. Its wait mode is safe where `t3_thread_wait` was not: a child that messages its parent ends its own turn, so the wait returns and the parent reads the message on its next turn (latency, never starvation). +- `delegate_task`, `task_status`, `task_cancel` — upstream's provider-owned child delegation. J5 re-declares `delegate_task` with its own description, which names the way to get help it serves and leads with the optional `persona` (a persona id from an `@persona:ID` mention or the Settings → Agent Setup library) and presents the plain child as the fallback for cross-provider or T3-tracked work rather than the default for any subagent request. With `persona`, the server pins that persona's instructions, model route, reasoning, and runtime policy and refuses `target` and `runtimeMode`; without it, the child is upstream's plain subagent, and the model it will run on, one inherited from its parent included, must be one the project's [Models for custom members](../features/crews.md) list allows. J5's wrapper hands upstream's `delegateTask` a hook that is called with that resolved model before anything is created, so the check sees what the child will really run on; a retry of a delegation already accepted is not checked again. A refusal is a `model_unavailable` error naming the model, the project and the setting and listing the eligible models, which the agent passes in `target`; a persona's own model is never checked. Upstream's `isolation: "worktree"` gives a child a checkout of its own, started from the parent's local commit, and the description says so in upstream's words. J5's description says it is the first of the two ways to get help (a subagent; the second is a Crew member). The child is backing storage under the calling thread, not a Peer Agent; `j5_spawn_agent` is the tool for a participant the user asked for. Its wait mode is safe where `t3_thread_wait` was not: a child that messages its parent ends its own turn, so the wait returns and the parent reads the message on its next turn (latency, never starvation). - `schedule_task` (which also updates a task since upstream folded `update_scheduled_task` into it at v0.1.3), `list_scheduled_tasks`, `delete_scheduled_task`, `run_scheduled_task_now` — consumed as-is. - `t3_thread_list`, `t3_thread_read` — consumed as-is; if an upstream description mentions delegation, J5 re-declares that tool with corrected prose. - `html_preview`, `html_render`, `request_secret`, `preview_dialog`, `preview_act`, `watch_pull_request`, `unwatch_pull_request` — consumed as-is. `preview_act` is upstream's one browser-control tool since v0.1.3, in place of `preview_click`, `preview_drag`, `preview_hover`, `preview_press`, `preview_scroll`, `preview_select`, `preview_type` and `preview_upload`. diff --git a/docs/j5/product/agent-personas/index.md b/docs/j5/product/agent-personas/index.md index 2dd75b07821c5..f640d9fb406d2 100644 --- a/docs/j5/product/agent-personas/index.md +++ b/docs/j5/product/agent-personas/index.md @@ -205,7 +205,7 @@ Settings → Agent Setup displays the selected environment's persona library, in Activation continues through the existing orchestrator launch contract. No direct persona picker or editor is added in this slice. A launched task shows its snapshotted display name and fixed route. Runtime activity for launched provider children stays in upstream's Lineage section and subagent cards, separate from the persona library. -Agents can also launch a persona as a Peer Agent: `j5_spawn_agent` accepts an optional `agent` id, keeps provider, model, and reasoning required, and refuses any pick outside that persona's declared routes. The resulting thread carries the same immutable assignment as a composer launch. See [agent tools](../a2a/agent-tools.md). +Agents can also launch a persona as a Peer Agent: `j5_spawn_agent` accepts an optional `persona` id, keeps provider, model, and reasoning required, and refuses any pick outside that persona's declared routes. The resulting thread carries the same immutable assignment as a composer launch. See [agent tools](../a2a/agent-tools.md). ## Verification and remaining work diff --git a/docs/j5/product/features/crews.md b/docs/j5/product/features/crews.md index c866b5d56c652..29be629795993 100644 --- a/docs/j5/product/features/crews.md +++ b/docs/j5/product/features/crews.md @@ -11,7 +11,7 @@ Complex work needs a group of agents with defined jobs working together with a h ## Definition -A **Crew** is a group of agents formed as a unit from a **roster its Captain proposes, approved by the person by default**, composed for the brief in front of it. Nobody writes a Crew file in advance. The person asks the agent in an ordinary conversation to compose a Crew (web and desktop). The agent uses the conversation as context, keeps its current persona, model, and policy, and proposes the team before starting its work. There is no Crew slash command. No dedicated Captain agent exists; the agent that proposes becomes the Captain. It proposes a roster — a name, the brief every seat will start on, and a responsibility with a reason and instructions for each member. Saved personas are optional templates; a roster can mix them with custom members. A seat may name no persona at all: a **custom seat**, named and briefed by the Captain or the person, defaults to the Captain's provider, model, and reasoning, where the project's models for custom members allow that model, but to Full access, with harness, model, reasoning, and access editable before approval, so a Crew need not fit a mold anyone saved before (Jackson and Bryant, 2026-09-17). The Captain's access is never carried: a seat nobody configured would otherwise stop for approvals in a thread the person is not watching (Jackson, 2026-09-26). Its instructions are required at every door, since nothing else defines it. By default the proposal is a **human gate**, answered inline above the Captain's composer and never on the Inbox bell. **Settings → Agent Setup → Crews → Auto-approve new Crews** skips that gate when enabled for the Captain's project; it is off by default with project overrides. The setting is read for each new request, and changes leave existing Crews and open proposals alone. The Captain is the thread the person watches, so its own tool approvals and questions are answered inline there too. A seat runs out of view, so its provider tool approvals are answered from the Inbox (Jackson, 2026-09-26). A seat has no native question tool: when it needs a decision it asks its Captain with `j5_send_message`, and the Captain answers, or asks the person with its own question tool, inline in the Captain thread (Jackson, 2026-09-26). Claude seats run without `AskUserQuestion` and Codex seats without `request_user_input`; Cursor exposes no structured native question tool. Other harnesses keep their native tools and the standing rule to ask the Captain. If a seat still raises a native question, its Captain receives a queued notice naming the question and its thread. The person also sees a link in the Inbox to answer in the seat's original question form (Bryant, 2026-10-19). The person may drop seats, select personas from the library, or create custom seats with names, instructions, and runtime settings. Every proposed or manually added member uses the same editor before approval. Saved personas supply defaults; the person may override harness, model, reasoning, and access for this member without changing the saved definition. Approval creates every seat as a Peer Agent placed under the Captain, with a persona assignment only when the seat names a saved definition, and records the roster snapshot (the _Manifest_ in implementation vocabulary: name, brief, members with each one's reason and version). It starts no provider turns. The Captain receives a creation report naming what the person changed and which seats were created or failed. A decline is told at once. Each seat's first delivered assignment carries the platform's identity facts, the current Crew context and roster, any seat instructions, a handoff artifact obligation when its definition declares one, and the approved brief. +A **Crew** is a group of agents formed as a unit from a **roster its Captain proposes, approved by the person by default**, composed for the brief in front of it. Nobody writes a Crew file in advance. The person can ask for a Crew in an ordinary conversation (web and desktop), and an agent also chooses one when the work needs workers who must respond to each other (AC1). Once it chooses a Crew, the agent uses the conversation as context, keeps its current persona, model, and policy, and proposes the team before starting its work. There is no Crew slash command. No dedicated Captain agent exists; the agent that proposes becomes the Captain. It proposes a roster — a name, the brief every seat will start on, and a responsibility with a reason and instructions for each member. Saved personas are optional templates; a roster can mix them with custom members. A seat may name no persona at all: a **custom seat**, named and briefed by the Captain or the person, defaults to the Captain's provider, model, and reasoning, where the project's models for custom members allow that model, but to Full access, with harness, model, reasoning, and access editable before approval, so a Crew need not fit a mold anyone saved before (Jackson and Bryant, 2026-09-17). The Captain's access is never carried: a seat nobody configured would otherwise stop for approvals in a thread the person is not watching (Jackson, 2026-09-26). Its instructions are required at every door, since nothing else defines it. By default the proposal is a **human gate**, answered inline above the Captain's composer and never on the Inbox bell. **Settings → Agent Setup → Crews → Auto-approve new Crews** skips that gate when enabled for the Captain's project; it is off by default with project overrides. The setting is read for each new request, and changes leave existing Crews and open proposals alone. The Captain is the thread the person watches, so its own tool approvals and questions are answered inline there too. A seat runs out of view, so its provider tool approvals are answered from the Inbox (Jackson, 2026-09-26). A seat has no native question tool: when it needs a decision it asks its Captain with `j5_send_message`, and the Captain answers, or asks the person with its own question tool, inline in the Captain thread (Jackson, 2026-09-26). Claude seats run without `AskUserQuestion` and Codex seats without `request_user_input`; Cursor exposes no structured native question tool. Other harnesses keep their native tools and the standing rule to ask the Captain. If a seat still raises a native question, its Captain receives a queued notice naming the question and its thread. The person also sees a link in the Inbox to answer in the seat's original question form (Bryant, 2026-10-19). The person may drop seats, select personas from the library, or create custom seats with names, instructions, and runtime settings. Every proposed or manually added member uses the same editor before approval. Saved personas supply defaults; the person may override harness, model, reasoning, and access for this member without changing the saved definition. Approval creates every seat as a Peer Agent placed under the Captain, with a persona assignment only when the seat names a saved definition, and records the roster snapshot (the _Manifest_ in implementation vocabulary: name, brief, members with each one's reason and version). It starts no provider turns. The Captain receives a creation report naming what the person changed and which seats were created or failed. A decline is told at once. Each seat's first delivered assignment carries the platform's identity facts, the current Crew context and roster, any seat instructions, a handoff artifact obligation when its definition declares one, and the approved brief. **Captains add members directly.** When the work needs expertise the roster lacks, the Captain adds one seat with a reason and optional brief. No human approval is needed, regardless of the auto-approval setting. The same launch checks apply; the tool returns the updated roster or a refusal naming the member and reason, and the launch report follows. A Crew holds at most **twelve seats**, counting open legacy requests. Members escalate staffing needs to their Captain. Pending addition requests from before this change remain approvable or declinable above their Captain's composer and stay off the Inbox and its bell. @@ -21,7 +21,7 @@ A **Crew** is a group of agents formed as a unit from a **roster its Captain pro **Several people.** Where more than one person can write to a Captain's thread, "the person" in this definition is any of them. The roster and a seat's tool approvals go to everyone who can write to that thread, and the first answer settles each; anyone who can write to the Captain's thread can write to its seats too ([shared conversations](shared-conversations.md), [people and access](people-and-access.md)). -**Communication is direct; handoff artifacts record durable outputs.** Members exchange findings, questions, blockers, and results directly with one another and their Captain; Captains can coordinate with other Captains. Neither an artifact nor a human approval is required for these messages. Members send their final result with evidence and unresolved issues to the Captain. Active Codex GPT 6 and Claude runs accept peer steering, Claude once its running tool calls finish; other models and providers queue messages until the next safe turn boundary. A seat whose persona declares an output artifact (a Critic's ReviewHandoff, a Scout's ContextBrief) owes it as the same shared handoff artifact every persona writes — `handoffs//-.md` in the project's artifacts (see the [persona contract](../agent-personas/index.md)) — and its first turn names that exact path. The handoff gate checks for the file when a run ends and reminds the seat once. File existence is evidence of delivery, not validation or acceptance of the result; the Captain reviews the handoff artifact against the task. **Every seat tells its Captain when it finishes**, as measured facts: how the run ended first, the run's error when it failed, and whether its handoff artifact was written, missing, unavailable (with why), or never declared, with the artifact inline when short. A first turn that fails is a launch outcome, told once by the launch report and not again as a finish; and a seat's failure that its Captain hears this way is not repeated by the silence detector as an unanswered ask. The notice is posted the first time a seat finishes and again only when those facts change; a finish that would repeat the last notice word for word is silent, because the seat's own reply already reached the Captain. Notices that arrive while the Captain's turn is running fold into the one seat notice already queued behind that turn, so the Captain absorbs its Crew's news in one turn rather than one per seat. Notice delivery retries on a later finish or the next server startup if dispatch fails; it is not guaranteed promptly while the seat stays idle. Sign-in and permission failures also raise a platform notice in the person’s Inbox, with replies routed to the Captain; other failures remain for the Captain to assess. A Captain normally does not have to interview its Crew to learn a seat is done, and it never waits for one inside a turn: `t3_thread_wait` is not on its surface, because a turn that blocks cannot receive the notice it is waiting for. The person opens every handoff on the Artifacts page. A direct result message does not replace a handoff artifact explicitly required by a saved persona. +**Communication is direct; handoff artifacts record durable outputs.** Members exchange findings, questions, and results directly with one another and their Captain, and run their own review loops (AC9); Captains can coordinate with other Captains. Neither an artifact nor a human approval is required for these messages. Members send their final result with evidence and unresolved issues to the Captain. How a message reaches a running turn depends on the provider (Messages and steering, below). A seat whose persona declares an output artifact (a Critic's ReviewHandoff, a Scout's ContextBrief) owes it as the same shared handoff artifact every persona writes — `handoffs//-.md` in the project's artifacts (see the [persona contract](../agent-personas/index.md)) — and its first turn names that exact path. The handoff gate checks for the file when a run ends and reminds the seat once. File existence is evidence of delivery, not validation or acceptance of the result; the Captain reviews the handoff artifact against the task. **Every seat tells its Captain when it finishes**, as measured facts: how the run ended first, the run's error when it failed, and whether its handoff artifact was written, missing, unavailable (with why), or never declared, with the artifact inline when short. A first turn that fails is a launch outcome, told once by the launch report and not again as a finish; and a seat's failure that its Captain hears this way is not repeated by the silence detector as an unanswered ask. The notice is posted the first time a seat finishes and again only when those facts change; a finish that would repeat the last notice word for word is silent, because the seat's own reply already reached the Captain. Notices that arrive while the Captain's turn is running fold into the one seat notice already queued behind that turn, so the Captain absorbs its Crew's news in one turn rather than one per seat. Notice delivery retries on a later finish or the next server startup if dispatch fails; it is not guaranteed promptly while the seat stays idle. Sign-in and permission failures also raise a platform notice in the person’s Inbox, with replies routed to the Captain; other failures remain for the Captain to assess. A Captain normally does not have to interview its Crew to learn a seat is done, and it never waits for one inside a turn: `t3_thread_wait` is not on its surface, because a turn that blocks cannot receive the notice it is waiting for. The person opens every handoff on the Artifacts page. A direct result message does not replace a handoff artifact explicitly required by a saved persona. **Members report their finish.** When a member's run ends and it owes no open reply, the platform tells its Captain how the run ended and where its handoff artifact stands; a later message runs normally. The platform never settles a seat because its run finished: upstream settles by hand, by merged PR, or by idle days, and a seat marked settled seconds after launch read as wrong (Jackson, 2026-09-17). Settling the Captain settles its seats (AC17). **A Crew's state is its seats' states**, summarized from measured facts — how many seats are running, need a person, or were settled — on the Crew's row of the Fleet page and on the Captain's expander in the sidebar, where each seat's row also says how its last run ended (failed, interrupted, or completed); the person never has to interview a Crew to learn where it stands. **The Captain's timeline keeps approval compact and shows what needs attention.** The launch report and finish notices reach the Captain unchanged, but the person sees one line per seat that couldn't start, was never created, hasn't confirmed it started, failed, or finished with its handoff artifact missing or unreadable, each opening the seat's thread when it has one; a roster approval shows “Crew approved · N members” from the stored gate notice, including in existing threads; a clean finish shows nothing, and an interruption after the first turn, which comes from a stop, is silent there too. Members stay out of the thread sidebar unless pinned; the Captain's row carries the Captain's anchor mark and an expander into its members; the Fleet page lists every agent by project and placement with each Crew under its Captain. Crews are a web and desktop surface; mobile has no Crew surface today, deliberately. @@ -47,11 +47,25 @@ Crews are deliberately disposable. They **archive only as a unit** — members a The platform ships the machinery — propose, gate, spawn, render, remind, notify, archive. The Captain agent that composes a Crew, the personas it seats, and any Playbook it follows are always the user's content: the PR Group is one Captain's proposal someone approved, never the product's opinion. +### Messages and steering + +A message to a member or Captain with a running turn lands one of three ways, set by its provider and by whether the sender asked for `mode: "steer"`: it **steers directly** into the running turn, it **steers by interrupt-restart** (upstream stops the turn and restarts it on the message, which only an explicit `steer` asks for), or it **queues** until the next turn boundary. An idle member, and a member that has not started, takes the message as a new turn. + +| Provider | Peer update, no `mode` | `mode: "steer"` | +| --------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------ | +| Codex, GPT 6 models | steers directly | steers directly | +| Codex, other models | queues | steers directly | +| Claude | steers directly, once its running tool calls finish | steers directly | +| Cursor | queues | steers by interrupt-restart | +| OpenCode, Pi and Muse; ACP agents | queues | directly (OpenCode, Pi, Muse) or by interrupt-restart (ACP agents) | + +A steer that races a Stop is a known case ([FORK.md](../../../FORK.md) case 26). + ## Acceptance criteria ### Launch and the gate -1. Asking for a Crew in ordinary chat causes the current agent to propose a roster before doing the delegated work. The thread retains its persona, model, and policy; saved personas are optional and there is no Crew slash command. +1. An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism (Jackson, 2026-10-31); a word mentioned in passing, or in quoted text, is not a request. When the person asked for none, an agent chooses between working directly, subagents for independent assignments, and a Crew for work whose workers must respond to each other, from the work. It may reassess mid-work and carry finished findings forward without restarting completed work. Once it chooses a Crew it proposes a roster before doing the delegated work. The thread retains its persona, model, and policy; saved personas are optional and there is no Crew slash command. 2. Initial roster proposals start collapsed in a compact strip above the Captain’s composer, alongside Tasks and Playbooks. Expanding or collapsing the strip is remembered for that thread and environment; the roster draft survives collapsing and the strip leaving while the composer shows an approval or a question, until the person decides. The person reviews the outcome and members, adds or removes members, edits a member in a modal, and approves or declines the final roster. Add and Edit share the same modal: Cancel discards that modal’s changes, while Save validates the member and returns to the roster. Invalid or duplicate names and missing custom-member instructions prevent saving. The last member cannot be removed. Approval is unavailable while a modal is open or a matching full-roster preview is missing. With Auto-approve new Crews enabled for the Captain’s project, it launches as proposed with no card. 3. Each proposal member shows its provider, name, model, reasoning, access, and the Captain’s reason. Non-shared workspaces and access that stops for approvals remain visible. The Persona picker offers Custom member and the available saved personas. Selecting a saved persona populates its name and instructions and resolves its runtime defaults; the saved definition is unchanged. The instructions box holds the persona’s whole text, and an edit replaces the persona’s instructions for this member only; the original is not also sent, and Reset to persona text returns the box to the saved text. The instructions an agent attaches to a persona seat stay additional, and an unedited box keeps them. Runtime and workspace choices remain editable. A new custom member starts in the Captain’s checkout. Existing and new worktrees use the Captain’s repository options. Editing the roster refreshes the server preview, which binds the exact runtime settings, Captain’s project and checkout, each seat’s workspace, and the current playbook plan. Missing, unavailable, incomplete, or stale previews cannot approve a launch. Playbook proposals retain each member’s steps, persona-swap explanations, and unowned steps for the Captain. The card cannot reassign steps; removing a member leaves its steps unowned. 4. A seat naming an agent missing from or disabled in the library, a duplicate seat name, or a roster past twelve seats is refused to the Captain with the next step, before anything spawns; prose is never parsed. So are an unknown or invalid playbook, a step the playbook lacks, a step claimed by two seats (or already owned by a live member), and steps on a Crew without a playbook. A seat that claims no steps needs no readable playbook, so a Crew whose playbook file is gone can still grow. Each step has one owner, enforced again where member rows are written, so of two additions racing for one step the first reservation wins and the second is refused. @@ -62,7 +76,7 @@ The platform ships the machinery — propose, gate, spawn, render, remind, notif 6. Approval creates every seat as a Peer Agent placed under the Captain and records the roster snapshot with each member's reason (human or automatic approval is recorded); it starts no turns. A proposal resolves once, so a second approval creates nothing and a decision racing another device's answer is refused. The Captain receives one launch report immediately after creation, naming the person's changes, each created seat as waiting for work, and any creation failures. A seat whose provider is signed out is refused before creation. The first participant message, direct chat message, or playbook step activates a waiting seat with its approved instructions and shared brief, the roster at activation including responsibilities and participant ids, and the assignment with its envelope and reply obligation intact. 7. An approval launches once. A failure before any seat spawns (the Crew or the approval could not be recorded) leaves the gate open to approve again; once seats start spawning, a seat that fails does not stop the others, and the launch report names every approved seat, including one whose thread was never created. A seat that was never created is not on the roster; the Captain asks for it again with `j5_request_crew_member`. 8. A Crew lives in exactly one project and renders as one node under its Captain with its members beneath it. -9. Every member can message any participant; the Crew's contact with the person goes through the inbox or its Captain rather than chat — a plain send to the person is refused by the [human-ask rule](../a2a/agent-tools.md), so a seat reaches the person only with an ask that lands in the Inbox or a reply on an open Exchange. A live Crew seat's pending provider approvals that the provider can still take are listed in the Inbox with their Crew and seat, counted on the bell, and answerable there; the seat's own thread still shows them too, so either place may answer. The Captain's approvals and questions, and approvals a seat can no longer take, are not listed. A live seat's pending native question that can still take an answer is listed as an Inbox link and counted on the bell; it is answered in the original thread, and the link disappears when resolved. A seat asks its Captain rather than the person: Claude and Codex seats have no native question tool, and every seat is told to ask its Captain with `j5_send_message`; a harness that still lets a seat ask natively shows the question in the seat's thread and notifies its Captain. The Captain may answer through upstream's pending-request tools when its modes allow and the answer follows the brief or the person's instructions; otherwise it asks the person to answer in the seat's thread. Native questions are not Inbox Exchanges. An answer to a request already resolved elsewhere is refused and changes nothing. +9. Every member can message any participant, and members run their own review loops. A reviewer sends findings straight to the teammate who owns the work, the owner sends the fix straight back, and they repeat until no finding is unresolved; a loop with no clean pass after three rounds (a round is one findings message and the fix that answers it) goes to the Captain as a blocker or a disagreement. A member messages its Captain only for a review pass that names the commit or change reviewed, a blocker that names what is needed, a disagreement it could not settle, and its final result when it finishes; it sends no acknowledgments or progress updates. The Captain owns the outcome: it settles technical disagreements within the agreed scope itself and asks the person only when product intent or judgment is needed. Playbook step hand-offs are unchanged. How each message reaches a running turn is in Messages and steering. The Crew's contact with the person goes through the inbox or its Captain rather than chat — a plain send to the person is refused by the [human-ask rule](../a2a/agent-tools.md), so a seat reaches the person only with an ask that lands in the Inbox or a reply on an open Exchange. A live Crew seat's pending provider approvals that the provider can still take are listed in the Inbox with their Crew and seat, counted on the bell, and answerable there; the seat's own thread still shows them too, so either place may answer. The Captain's approvals and questions, and approvals a seat can no longer take, are not listed. A live seat's pending native question that can still take an answer is listed as an Inbox link and counted on the bell; it is answered in the original thread, and the link disappears when resolved. A seat asks its Captain rather than the person: Claude and Codex seats have no native question tool, and every seat is told to ask its Captain with `j5_send_message`; a harness that still lets a seat ask natively shows the question in the seat's thread and notifies its Captain. The Captain may answer through upstream's pending-request tools when its modes allow and the answer follows the brief or the person's instructions; otherwise it asks the person to answer in the seat's thread. Native questions are not Inbox Exchanges. An answer to a request already resolved elsewhere is refused and changes nothing. ### Growing @@ -108,6 +122,7 @@ The platform ships the machinery — propose, gate, spawn, render, remind, notif ## Scenarios +- **A review loop.** The Builder pushes a commit and tells the Critic. The Critic sends its findings to the Builder, not to the Captain; the Builder fixes them and replies to the Critic. After the second round the Critic has no findings left and sends the Captain one review pass naming the commit it reviewed. The Captain never relayed a message. (AC9, AC24) - **A pull-request Crew.** In Billing Migration the user sends "Put together a crew to land the invoice-export PR: build, review, sit on CI." The Captain proposes Builder, Critic, and Sitter with a reason each; the user drops the Sitter, approves, and the two seats appear under the Captain as Not started. The Captain sends the Builder its assignment, then sends the Critic the review assignment when code is ready. Each receives the brief and current roster on activation. The Critic finishes and writes its ReviewHandoff into the project's artifacts; the Captain's thread receives the notice with the findings inline. (AC1, AC2, AC6, AC8, AC12, AC13) - **Two Crews at once.** In Website Redesign the user, mid-conversation with the agent that has been planning the launch, sends "Create a crew to migrate the blog to the new CMS" and then "Create another crew to rewrite the pricing page copy". The same thread proposes two rosters, each answered above its composer; both appear under the Captain's row as named groups, Blog Migration and Pricing Copy, each with its own toggle, state, and Stop. (AC1, AC2, AC15) - **More hands.** The Captain adds a Sitter for the CI failures directly; the seat joins at version 2. A signed-out provider instead refuses the named seat without adding it. A Builder trying to add a helper is refused and told to escalate to its Captain. (AC10, AC11) @@ -157,4 +172,5 @@ The platform ships the machinery — propose, gate, spawn, render, remind, notif - 2026-10-17 — several people (Jackson; [record](../../worklog/2026-10-16-people-and-access-session.md)): "the person" is anyone who can write to the Captain's thread, and a Crew's later requests reach all of them, which ends the stall where a guest who asked for a Crew never saw its seats' approvals (AC23; [#534](https://github.com/Jacksondr5/j5code/issues/534)). - 2026-10-27 — the Captain's timeline shows the person only what they would act on: launch and finish notices become one line per seat that needs them, and each seat's row says how its last run ended (Bryant; [#741](https://github.com/Jacksondr5/j5code/issues/741)). - 2026-10-27 — models for custom members: a project's lists of checked models and checked reasoning levels decide what custom seats, plain spawned agents and plain delegated tasks run on; personas keep their own; native subagents are outside the lists on every provider (AC24–AC30; Bryant; [#744](https://github.com/Jacksondr5/j5code/issues/744)). +- 2026-10-27 — when the person asked for none, an agent chooses between working directly, subagents, and a Crew from the work; an explicit request for a Crew, a Peer Agent or a subagent still gets that mechanism; members run their own review loops and reach the Captain only for a review pass, a blocker, or a disagreement, or their final result (AC1, AC9; Bryant and Jackson; [#746](https://github.com/Jacksondr5/j5code/issues/746)). - 2026-10-31 — a member's introduction and roster changes are visible in its own thread, as a collapsed card that opens to what the model read, where they had been sent to the model only (Jackson, 2026-10-31; register D43). diff --git a/docs/j5/product/glossary.md b/docs/j5/product/glossary.md index 71538a1c4c6cd..394fcae0bd4b3 100644 --- a/docs/j5/product/glossary.md +++ b/docs/j5/product/glossary.md @@ -109,4 +109,4 @@ These entries are the distinctions the whole team must share; the glossary owns | epic, Squadron | Not a concept. A thread's home is its project, with upstream's meaning. Records before 2026-10-05 use "Squadron" ("epic" before 2026-08-17) for a J5 grouping that referenced a project | | team | Not a concept. Crew is the group that works as a unit; there is no other grouping | | thread (as the reply obligation) | Exchange. "Thread" means only upstream's conversation | -| delegate_task | Not on the J5 agent surface; a Peer Agent spawn carries its task in the brief, and an Exchange carries any later obligation | +| delegate_task | On the J5 agent surface as a way to create a subagent, across providers or as a saved persona; it never creates a Peer Agent, and an Exchange carries any later obligation | diff --git a/docs/j5/product/upstream.md b/docs/j5/product/upstream.md index f0211892e2586..03064efe06594 100644 --- a/docs/j5/product/upstream.md +++ b/docs/j5/product/upstream.md @@ -46,17 +46,17 @@ Letter codes in the Decided lines (SC2, QS1, AR3, and so on) are rulings recorde ### Agents and orchestration -#### D1. Help is a Subagent, a Peer Agent, or a Crew +#### D1. Help is a Subagent or a Crew member, chosen from the work unless the person names one **Upstream:** the instructions every agent receives point it to `delegate_task` for help from another provider, or from a model its own subagent tool can't run, and to `t3_thread_launch` or `create_threads` to start new threads. -**J5:** agents are told about three shapes of help: a Subagent their own provider runs, a Peer Agent started with `j5_spawn_agent`, and a Crew proposed with `j5_propose_crew`. `delegate_task` is kept for narrow cases: running a saved persona as a subagent, work on another provider that the person doesn't need to talk to directly, and, as upstream says, a model the provider's own subagent tool can't run or a child that needs a checkout of its own (a worktree started from the parent's local commit). A review that takes several rounds gets a new `delegate_task` call for each round. +**J5:** an explicit request for a Crew, a Peer Agent or a subagent gets that mechanism, and a word mentioned in passing or in quoted text is not a request. When the person asked for none, agents are told to choose among working directly, subagents for independent assignments, and a Crew for work whose workers must respond to each other, from the work, and may reassess mid-work without restarting completed work. There are two ways to get help: create a subagent (their provider's own, or `delegate_task` across providers), or put members on a Crew (`j5_propose_crew` to start one, `j5_request_crew_member` to grow one). `j5_spawn_agent` stays for a user's explicit request for a Peer Agent or a standalone agent they will talk to, and for callers that already use it (outside agents, skills); when nobody asked for one it is not described as a way to get help. `delegate_task` is kept for narrow cases: running a saved persona as a subagent, work on another provider that the person doesn't need to talk to directly, and, as upstream says, a model the provider's own subagent tool can't run or a child that needs a checkout of its own (a worktree started from the parent's local commit). A review that takes several rounds gets a new `delegate_task` call for each round. -**Why:** upstream's delegated child is "a Peer Agent in a Subagent costume": the person can't talk to it, yet it outlives the agent that started it. That is the awkward middle J5's vocabulary exists to remove. The Crew shape was added after an agent asked to "spawn a crew" made subagents instead, because nothing it had been told mentioned a Crew. Personas later gave `delegate_task` a purpose again: a persona needs a way to run as a subagent. +**Why:** upstream's delegated child is "a Peer Agent in a Subagent costume": the person can't talk to it, yet it outlives the agent that started it. That is the awkward middle J5's vocabulary exists to remove. The Crew shape was added after an agent asked to "spawn a crew" made subagents instead, because nothing it had been told mentioned a Crew. The rule that the word "crew" decides was narrowed on 2026-10-27: it sent agents to a Crew because the user said "crew", and to a standalone Peer Agent when a subagent would do. An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism again (Jackson, 2026-10-31); the choice from the work applies only when the person asked for none. Personas later gave `delegate_task` a purpose again: a persona needs a way to run as a subagent. **Consequences:** upstream's launch and workspace guidance never reaches J5 agents. `j5_spawn_agent` and Crew seats require their own workspace choice instead, with upstream's `existing_worktree` name and shape beside `shared` and `worktree`, and reuse upstream's ThreadLaunch to prepare a new worktree (#274). A spawn may also name upstream's `root`, the project's main checkout, and may join another project or upstream's "No project" project (#519); a Crew seat stays in its Captain's project with the first three choices. J5's text lives in a J5 folder inside upstream's shared provider package, and the constant upstream exports for its own text points at it. So J5's text reaches every harness that reads that constant: Codex, Claude, Cursor, OpenCode, the ACP agents and Pi, and any provider upstream later moves into a package of its own. Every upstream advance ports upstream's prompt changes into it by hand, and a test pins J5's wording. J5 takes upstream's own sections as upstream writes them: secrets, thread links, showing visuals, the browser, and the `delegate_task` rules above. Since v0.1.3 they are upstream's shorter text, with its rule on settings: a native subagent is right when the child needs no settings beyond the parent's, and only settings the user asked for send a child through `delegate_task`. J5's own description of `delegate_task` is its persona rules followed by upstream's short text; upstream's mechanics (the worktree option, a wait that ends at the child's question, runtime modes, options) are on the input fields J5 reuses. -**Decided:** Jackson with Product, 2026-08-24 (ST1–ST5); the Crew shape on 2026-09-17; the persona route in Jackson's review of 2026-09-13, which partly reverses ST5; the sections taken from upstream by Jackson, 2026-10-08; the text's home in the shared package, so that Pi and later provider packages get it, by Jackson, 2026-10-09; the worktree rule ported at the 2026-10-17 advance. Whether `delegate_task` stays at all is under discussion (#336). Recorded in FORK.md case 8 and the saved-agent mentions section. +**Decided:** Jackson with Product, 2026-08-24 (ST1–ST5); the Crew shape on 2026-09-17; the persona route in Jackson's review of 2026-09-13, which partly reverses ST5; the sections taken from upstream by Jackson, 2026-10-08; the text's home in the shared package, so that Pi and later provider packages get it, by Jackson, 2026-10-09; the worktree rule ported at the 2026-10-17 advance; the choice from the work and the two ways to get help by Bryant, 2026-10-27 ([#746](https://github.com/Jacksondr5/j5code/issues/746)). Whether `delegate_task` stays at all is under discussion (#336). Recorded in FORK.md case 8 and the saved-agent mentions section. #### D2. Agents see a fail-closed subset of upstream's MCP tools @@ -655,4 +655,5 @@ J5 kept a run from resuming after a usage-limit reset when the person had presse - 2026-10-31 — D33: "Merge back" is disabled for someone who can't start a thread in the fork's project, which the server already refused (Jackson's 2026-10-31 approval; [#730](https://github.com/Jacksondr5/j5code/issues/730)). - 2026-11-01 — D33: the mobile client reads shared conversations as web does, with each message's author and avatar, who answered each prompt, and another person's message held until its author is known; sharing itself stays on web and desktop (the mobile catch-up; [#832](https://github.com/Jacksondr5/j5code/issues/832), [#871](https://github.com/Jacksondr5/j5code/issues/871), [#869](https://github.com/Jacksondr5/j5code/issues/869)). - 2026-11-01 — D41 added: on mobile, a draft's persona has its own row under the checkout row, and the slash menu covers the draft rows (Jackson, Checkpoint 1; [#866](https://github.com/Jacksondr5/j5code/issues/866)). +- 2026-10-27 — D1: when the person asked for none, agents choose between working directly, subagents and a Crew from the work, and get help in two ways, a subagent or a Crew member; an explicit request for a Crew, a Peer Agent or a subagent still gets that mechanism; `j5_spawn_agent` is described as for a Peer Agent the user asks for, not as a way to get help (Bryant, with Jackson's 2026-10-31 decision; [#746](https://github.com/Jacksondr5/j5code/issues/746)). - 2026-10-31 — D43 added: a thread can keep a message the platform wrote without a run, so a Crew member's introduction and roster changes show in its own thread (Jackson, 2026-10-31). diff --git a/docs/j5/user/personas.md b/docs/j5/user/personas.md index 21f80ae6f4b37..b711ebd2a4e57 100644 --- a/docs/j5/user/personas.md +++ b/docs/j5/user/personas.md @@ -42,7 +42,7 @@ An agent can also start a persona as a peer with its own top-level task by namin ## Crews -A crew is a group of agents that one agent, the Captain, runs as a unit for one piece of work. Ask the agent in your current conversation to put a crew together, using ordinary chat. For example: +A crew is a group of agents that one agent, the Captain, runs as a unit for one piece of work. Ask the agent in your current conversation to put a crew together, using ordinary chat. Ask for a crew and you get one. If you don't ask, the agent decides from the work whether a crew fits: it uses one when the workers must respond to each other, such as a builder and reviewers going back and forth on a change, and hands independent pieces to subagents instead. For example: > Put together a crew to follow @docs/runbooks/release.md for the 2.4 release and report back when the PR is green. @@ -59,7 +59,7 @@ A conversation on any harness can propose a crew. On **Codex** and **Claude**, t - **Cursor** proposes a crew only when the conversation runs in **Full access**. In other modes, a Cursor team admin can add the t3-code tools to the team's MCP tool allowlist. - An OpenCode conversation on an external server cannot propose a crew. -Members can talk directly to each other and their Captain, and Captains can coordinate with other Captains. They share findings, questions, blockers, and results as messages while work continues; creating a report is not a prerequisite for communication. Active Codex GPT 6 runs can receive peer messages during work; other models and providers receive queued messages at the next safe turn boundary. +Members can talk directly to each other and their Captain, and Captains can coordinate with other Captains. They share findings, questions, blockers, and results as messages while work continues; creating a report is not a prerequisite for communication. Active Codex GPT 6 and Claude runs take peer messages during work; other models and providers queue them for the next safe turn boundary. When a member needs help, it tells the Captain. The Captain can add another member directly, explaining the gap and assignment. No approval is needed for additions. Provider sign-in, capacity, and member configuration checks still apply; each member's access still controls its tool approvals in the Inbox. Existing addition requests from an older version can be approved or declined above their Captain's composer. diff --git a/packages/provider-core/src/j5/orchestrationInstructions.test.ts b/packages/provider-core/src/j5/orchestrationInstructions.test.ts index 24bd807d46508..f8f17d414544d 100644 --- a/packages/provider-core/src/j5/orchestrationInstructions.test.ts +++ b/packages/provider-core/src/j5/orchestrationInstructions.test.ts @@ -94,12 +94,45 @@ describe("J5 orchestration instructions", () => { ); }); - it("steers to provider-native Subagents and platform Peer Agents", () => { + it("honors an explicit request for a Crew, Peer Agent or subagent, and lets the work decide otherwise", () => { + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism", + ); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "a word mentioned in passing, or in quoted text, is not a request", + ); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "When the person did not ask for one, choose from the work itself", + ); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Work directly when delegation would not help"); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "Use subagents when the work splits into independent assignments", + ); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "Use a Crew when the work needs workers who must respond to each other", + ); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "You may reassess in the middle of the work"); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "do not restart completed work"); + assert.notInclude(J5_ORCHESTRATION_INSTRUCTIONS, "do not decide it"); + }); + + it("keeps j5_spawn_agent for a Peer Agent the person asked for", () => { assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "provider-native Subagent"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "your provider's native Subagent mechanism"); - assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Use platform `j5_spawn_agent`"); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "Use `j5_spawn_agent` when the user explicitly asks for a Peer Agent or a standalone agent they will talk to", + ); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "When nobody asked for one, it is not a way to get help with your own work", + ); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "what should come back in that brief"); - // Crews are the third shape of help; without this bullet an agent asked for a crew makes subagents. assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "A Crew is a group of Peer Agents"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Use `j5_propose_crew`"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Use `j5_list_participants`"); @@ -195,25 +228,17 @@ describe("J5 orchestration instructions", () => { ); }); - it("creates mixed crews from chat and keeps coordination independent of approvals and artifacts", () => { - assert.include( - J5_ORCHESTRATION_INSTRUCTIONS, - "A request to create, start, or assemble a crew must go through `j5_propose_crew` on the `t3-code` MCP server", - ); - assert.include( - J5_ORCHESTRATION_INSTRUCTIONS, - "Never substitute provider-native Subagents, `delegate_task`, or individual `j5_spawn_agent` calls for a requested crew", - ); - // Codex's own tool keeps its name: it is not J5's `j5_spawn_agent`. + it("creates mixed crews and keeps coordination independent of approvals and artifacts", () => { + // Codex's own tool keeps its name: it is not J5's `j5_spawn_agent`, and it makes subagents. assert.include( J5_ORCHESTRATION_INSTRUCTIONS, "Codex's native `spawn_agent` or collaboration tools", ); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "create Subagents, not a Crew"); assert.include( J5_ORCHESTRATION_INSTRUCTIONS, "report that blocker instead of launching replacement agents", ); - assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "asks for a crew in ordinary chat"); assert.include( J5_ORCHESTRATION_INSTRUCTIONS, "saved personas from `j5_list_personas` with custom seats", @@ -230,6 +255,9 @@ describe("J5 orchestration instructions", () => { J5_ORCHESTRATION_INSTRUCTIONS, "resolved provider, model, reasoning, and access", ); + // Approval creates seats; members start on their first assignment and are reused. + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "send each member its first assignment"); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Reuse finished members for follow-up work"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Captains of other crews"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "Do not wait for an artifact"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "`j5_request_crew_member`"); @@ -237,10 +265,28 @@ describe("J5 orchestration instructions", () => { J5_ORCHESTRATION_INSTRUCTIONS, "reason naming the concern and needed responsibility", ); - assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "while that request is pending"); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "it needs no approval"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "otherwise they queue for its next turn"); }); + it("has members run their own review loops and the Captain own the outcome", () => { + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "a reviewer sends findings straight to the teammate who owns the work", + ); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "until no finding is unresolved"); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "only for a review pass that names the commit or change it reviewed, a blocker that names what is needed, a disagreement the members could not settle, or its final result or step report", + ); + assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "no acknowledgments or progress updates"); + assert.include( + J5_ORCHESTRATION_INSTRUCTIONS, + "settle technical disagreements within the agreed scope yourself, and ask the user only when product intent or their judgment is needed", + ); + assert.notInclude(J5_ORCHESTRATION_INSTRUCTIONS, "deliveryOutcome"); + }); + it("routes durable planning outputs into artifacts and excludes working files", () => { assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "durable, user-consumable planning outputs"); assert.include(J5_ORCHESTRATION_INSTRUCTIONS, "`j5_write_artifact`"); diff --git a/packages/provider-core/src/j5/orchestrationInstructions.ts b/packages/provider-core/src/j5/orchestrationInstructions.ts index 1827cd2747a38..ec01c67c75c13 100644 --- a/packages/provider-core/src/j5/orchestrationInstructions.ts +++ b/packages/provider-core/src/j5/orchestrationInstructions.ts @@ -16,9 +16,15 @@ const CAPTAIN_PLAYBOOK_START = PLAYBOOK_INSTRUCTIONS.indexOf("\n- As a Captain") export const J5_ORCHESTRATION_SECTIONS: ReadonlyArray = [ `## J5 Code orchestration -Ordinary coding tasks need no J5 tools. The \`t3-code\` MCP server provides app-owned orchestration. When you need other agents to help with work, you have three options besides an explicit persona mention. Treat these concepts distinctly: +Ordinary coding tasks need no J5 tools. The \`t3-code\` MCP server provides app-owned orchestration. An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism; a word mentioned in passing, or in quoted text, is not a request. A request for a crew must go through \`j5_propose_crew\` and the app's human roster approval: never substitute provider-native Subagents, \`delegate_task\` or \`j5_spawn_agent\` for it (Codex's native \`spawn_agent\` or collaboration tools create Subagents, not a Crew). If the crew tool is unavailable or fails, report that blocker instead of launching replacement agents. The current interaction mode still governs whether you may execute the request. -A request to create, start, or assemble a crew must go through \`j5_propose_crew\` on the \`t3-code\` MCP server and the app's human roster approval. Never substitute provider-native Subagents, \`delegate_task\`, or individual \`j5_spawn_agent\` calls for a requested crew. This includes Codex's native \`spawn_agent\` or collaboration tools: they create Subagents, not a J5 Crew. Discover the platform tools before choosing a delegation mechanism; if the crew tool is unavailable or fails, report that blocker instead of launching replacement agents. Merely discussing crews or quoting a crew reference does not request a launch. The current interaction mode still governs whether you may execute the request. +When the person did not ask for one, choose from the work itself: + +- Work directly when delegation would not help: the task is small, tightly sequential, or depends on context only you hold. +- Use subagents when the work splits into independent assignments: each helper takes one, returns a result, and does not need to hear from the others. +- Use a Crew when the work needs workers who must respond to each other, such as a builder and reviewers who iterate on the same change until it is clean. + +You may reassess in the middle of the work, for example by starting a Crew once subagents' results show the pieces depend on each other. Carry what is finished and learned forward; do not restart completed work. ${AGENT_INVOCATION_INSTRUCTIONS} - A provider-native Subagent is child work created and owned inside one provider session; J5 observes it, while the persona mention above creates a J5-owned delegated child. For a subagent, or help the user does not need to see or message, use your provider's native Subagent mechanism when the child uses your provider, a model it offers, and no settings beyond yours, and it finishes in this turn (Claude \`Agent\` always with \`run_in_background:false\`; Codex \`spawn_agent\`, then wait). Otherwise use \`delegate_task\`: for another provider's model, for same-provider work when the native Subagent tool cannot run the chosen model, for user-asked settings, for a separate checkout (\`isolation:"worktree"\`), for background work, or when the user names \`delegate_task\`. A native type running another provider's model counts too. Use Workflow only when asked. @@ -26,9 +32,9 @@ ${AGENT_INVOCATION_INSTRUCTIONS} `- Every new delegated review or re-check is a new \`delegate_task\` carrying the original brief, prior findings, responses, and unresolved objections. Track each round by its own \`taskId\`. Fix small review findings yourself; start no delegate for them. When told to proceed without a delegate, or to run fewer, \`task_cancel\` the extras. Start no replacement. - Follow a running delegate's \`next\`: its completion wakes this thread, so end your turn. Do not poll it (\`task_status\`, \`sleep\`, watchers, Monitor, ScheduleWakeup). Stop a delegate run you replace or no longer need with \`task_cancel\`. - If you are a subagent or delegated child, do the work yourself. Start no subagents unless your task says to.`, - `- A Peer Agent is a full participant with its own top-level thread that the user can open and message. Use platform \`j5_spawn_agent\` when the user wants or would benefit from talking to the agent directly, including cross-provider work where the user needs a directly messageable participant. Its brief states the task and whether a reply is expected; when you need a reply, include what should come back in that brief instead of sending a follow-up ask. -- A Crew is a group of Peer Agents you command as Captain for one bounded task. Use \`j5_propose_crew\` when the user asks for a crew in ordinary chat or the work splits into distinct responsibilities that should run at once. Mix saved personas from \`j5_list_personas\` with custom seats: set persona for a saved persona, or omit it and provide task-specific instructions for a custom seat. Custom seats inherit your harness, model, and reasoning by default and run with full access unless you set \`runtime_mode\`; you can select their harness, model, reasoning, and access with \`model_selection\` (instanceId, model, options) and \`runtime_mode\` from \`orchestrator_capabilities\`. Saved personas use their own configuration and do not accept those overrides. The app shows the roster in your thread, with each seat's resolved provider, model, reasoning, and access, and it is approved, edited, or declined there. Approved seats are created under you without starting turns; send each member its first assignment when it has work, or hand it its first playbook step. Reuse finished members for follow-up work in the same thread; each seat's finish reaches you as a message. -- Crew members, their Captain, and Captains of other crews can coordinate directly with \`j5_send_message\`: share findings, concerns, questions, evidence, and final results when they would change the other agent's work, grouped into one message rather than sent as each one happens. A busy receiver handles each message as its own turn after its current one ends. Do not wait for an artifact or a separate coordination approval. Return results in messages unless the user or a selected persona explicitly requires an artifact; that output requirement never blocks conversation. If a concern needs expertise missing from the roster, the member tells its Captain, and the Captain uses \`j5_request_crew_member\` with the crew_instance_id and a clear reason naming the concern and needed responsibility. The user approves additions in the existing inbox; continue the already-approved work and coordination while that request is pending. + `- A Peer Agent is a full participant with its own top-level thread that the user can open and message. Use \`j5_spawn_agent\` when the user explicitly asks for a Peer Agent or a standalone agent they will talk to, or when a skill you are following names it. When nobody asked for one, it is not a way to get help with your own work: use a subagent or a Crew. Its brief states the task and whether a reply is expected; when you need a reply, include what should come back in that brief instead of sending a follow-up ask. +- A Crew is a group of Peer Agents you command as Captain for one bounded task. Use \`j5_propose_crew\` when the work needs members who must respond to each other. Mix saved personas from \`j5_list_personas\` with custom seats: set persona for a saved persona, or omit it and provide task-specific instructions for a custom seat. Custom seats inherit your harness, model, and reasoning by default and run with full access unless you set \`runtime_mode\`; you can select their harness, model, reasoning, and access with \`model_selection\` (instanceId, model, options) and \`runtime_mode\` from \`orchestrator_capabilities\`. Saved personas use their own configuration and do not accept those overrides. The app shows the roster in your thread, with each seat's resolved provider, model, reasoning, and access, and it is approved, edited, or declined there. Approval creates the seats without starting turns: send each member its first assignment when it has work, or hand it its first playbook step. Reuse finished members for follow-up work in the same thread; each seat's finish reaches you as a message. Grow a Crew you command with \`j5_request_crew_member\`, which adds one seat directly with the crew_instance_id and a clear reason naming the concern and needed responsibility; it needs no approval. +- Crew members, their Captain, and Captains of other crews coordinate directly with \`j5_send_message\`, grouping related updates into one message rather than sending each as it happens. Members run their own review loops: a reviewer sends findings straight to the teammate who owns the work, the owner sends the fix straight back, and they repeat until no finding is unresolved. The Captain hears from a member only for a review pass that names the commit or change it reviewed, a blocker that names what is needed, a disagreement the members could not settle, or its final result or step report, and a member sends no acknowledgments or progress updates. As Captain you own the outcome: settle technical disagreements within the agreed scope yourself, and ask the user only when product intent or their judgment is needed. A busy receiver handles each message as its own turn after its current one ends. Do not wait for an artifact or a separate coordination approval. Return results in messages unless the user or a selected persona explicitly requires an artifact; that output requirement never blocks conversation. If a concern needs expertise missing from the roster, the member tells its Captain, and the Captain adds a seat with \`j5_request_crew_member\`; continue the already-approved work and coordination meanwhile. - Use \`j5_list_participants\` to resolve an already-addressable agent or a person. It lists the people who can write to your thread; where more than one can, it also lists everyone here, and an ask to everyone here reaches all of them and is closed by the first reply. Use \`j5_send_message\` without expect_reply for updates or results that need no response. Only for later work owed by an existing participant, use \`j5_send_message(..., expect_reply=true, intent="...")\` to open an Exchange. The reply arrives later as an incoming message; continue with other work instead of polling or holding a turn open to wait. Messages reach a supported active turn through provider steering; otherwise they queue for its next turn.`, `- Given a thread id, \`t3_thread_read\` it before you answer about it. - In your reply, a thread's first mention is its \`link\` verbatim. No \`link\`: \`[title](t3-thread://v1/)\`. Never a plain title or bare id.