Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
cc1f8b7
feat(j5): j5_send_message tells the sender how a message will land (#…
bryantderosier Oct 27, 2026
0277f60
feat(j5): agents choose between subagents and Crew members from conte…
bryantderosier Oct 27, 2026
cf20f4f
docs(j5): Crews guidance, two ways to get help, steering by provider …
bryantderosier Oct 27, 2026
de8d55a
docs(j5): record the live steering results for Codex and Claude (#746)
bryantderosier Oct 27, 2026
d9f0d2e
fix(j5): the Captain also hears a member's final result or step repor…
bryantderosier Oct 28, 2026
380adfa
docs(j5): Messages and steering states behavior only; user doc names …
bryantderosier Oct 28, 2026
41ad120
merge: bring the updated reasoning-levels layer into the subagents-or…
bryantderosier Nov 2, 2026
4090e50
fix(j5): an explicit request picks the mechanism, and send results st…
bryantderosier Nov 2, 2026
f8abef4
merge: bring the updated reasoning-levels layer into the subagents-or…
bryantderosier Nov 2, 2026
3220f4c
fix(provider-core): drop an issue number from a test comment
bryantderosier Nov 2, 2026
87cb204
merge: pick up the archive cleanup test fix
bryantderosier Nov 2, 2026
dfe913a
merge: pick up the settings seam test fix
bryantderosier Nov 2, 2026
7b1e9ae
merge: pick up the Crew introduction record
bryantderosier Nov 2, 2026
4198525
merge: pick up the CI fixes from 770
bryantderosier Nov 2, 2026
a596927
style(j5): format the launch service after its error class stopped be…
bryantderosier Nov 2, 2026
3e67393
Merge remote-tracking branch 'origin/j5/crew-member-reasoning-levels'…
bryantderosier Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions FORK.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions apps/server/src/j5/a2a/crewGateNotice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/j5/a2a/crewGateNotice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ")}`;
};
16 changes: 16 additions & 0 deletions apps/server/src/j5/a2a/mcp/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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");
});
8 changes: 4 additions & 4 deletions apps/server/src/j5/a2a/mcp/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
18 changes: 18 additions & 0 deletions apps/server/src/j5/a2a/spawnIds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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,
Expand Down
Loading
Loading