Repository navigation
Closed
Description
Item 4 of 9 in the Crews: organic teamwork milestone.
The problem
When a Captain staffs a custom member, or an agent delegates a task to another provider, it can pick any model in the catalog. I have no way to say "custom workers run on these models", so I end up correcting runtime lines by hand on the roster card. Once additions and auto-approved launches skip the card entirely, I won't get the chance.
Where this sits
This is the "Model choice" row and the "Models for custom members" decision of Crews proposal v2 (25 October):
- One list of eligible provider models covers custom workers on both spawning paths, at launch and when added.
- The platform enforces the list.
- Personas run on their own configured model as an explicit exception.
It builds on Agent Setup and the scoped-settings plumbing from #743. It's a choice about which models are used, not a spending cap.
What we already have
- Custom seats take
seat.modelSelection ?? captain.thread.modelSelection(apps/server/src/j5/a2a/CrewLaunchService.ts:345). Every selection goes throughresolveSelection(:300), which already refuses a signed-out provider (:319). - Persona seats route through
prepareAgentPersonaLaunch(apps/server/src/j5/agents/agentPersonaLaunch.ts:54). j5_spawn_agentchecks its required model against capabilities inselectSpawnModel(mcp/handlers.ts:303).delegate_task: J5's wrapper (apps/server/src/j5/agents/agentDelegation.ts:60-76) passes a persona-less task to upstream'sOrchestratorMcpService.delegateTask. That resolves the target inresolveTarget(:1174) and inherits the parent's selection when no target is given (:1267). The wrapper only seestarget, not the resolved model.- The catalog's models are keyed by
(providerInstanceId, slug), the same shape asModelSelection, and carry the manifest'sbadge: "new"(packages/contracts/src/server.ts:74-80), which the composer already shows. - There's a precedent for a stored per-instance model list:
providerModelPreferences.hiddenModels(packages/contracts/src/settings.ts:285). - J5 doesn't control native subagents' models today. Adapters only record what the provider picked (
ClaudeAdapterV2.ts:3086-3104,CodexAdapterV2.ts:2712-2730).
Proposal
- Add a project-scoped server setting holding the checked
(instance, model)pairs for custom members. - When nothing has been saved, every model is eligible, which is today's behavior.
- Once I save a list, only checked models are eligible, and a model added to the catalog later starts unchecked.
- One J5 check decides eligibility. Crew launches, additions,
j5_spawn_agent, anddelegate_taskall call it with the resolved selection.
Acceptance criteria
Setting and UI
- A project-scoped server setting stores the eligible models as
(providerInstanceId, model)pairs. The upstream edit topackages/contracts/src/settings.tsis recorded in FORK.md. - Until a list is saved, every model is eligible and nothing changes for existing users.
- The Crews section of Agent Setup has a row, Models for custom members, showing a count such as "6 of 12". It opens in place.
- Each set-up provider lists its models with checkboxes and an "N of M" count. A provider that isn't set up shows one muted line linking to Providers.
- Once a list is saved, a model that later appears in the catalog starts unchecked. Models carrying the catalog's
newbadge show a "New" tag, the same badge the composer uses. - A note explains that personas always run on their own model, even one that isn't checked, and names any persona whose model isn't on the list.
- Project overrides work like the auto-approve switch: scoped-setting indicator, inheritance popover, and reset.
Enforcement
- One J5 service method decides whether a resolved selection is eligible for a custom worker in a project. Each path below calls it with the selection it's about to use.
- Crew launches and additions check every custom member, including auto-approved launches and a custom member that inherits the Captain's model.
- A seat that names a saved persona and keeps the persona's configured model skips the check. A persona seat whose model I overrode on the card is checked like a custom member.
-
j5_spawn_agentchecks its model when no persona is named. -
delegate_taskwithout a persona checks the model the child will actually run on, including one inherited from the parent. If that needs more than J5's wrapper can see, the PR brings the upstream edit for approval rather than skipping the check. - A refused model is a tool error naming the model, the project, and the setting: "Models for custom members in Agent Setup". It also lists the eligible models, so the agent can retry without guessing.
- On the roster card, a custom member's model picker offers only eligible models, and approving a member on an ineligible model is refused with the same message.
Native subagents
- A short investigation records, for Codex, Claude, and Cursor, whether J5 can set or restrict the model a native subagent runs on without changing upstream's adapter.
- The answer is written into crews.md per provider. Where it can't be done, it says "not supported here", and the Agent Setup note says the list doesn't cover native subagents on that provider.
Docs and tests
- Focused tests cover:
- no saved list (everything allowed);
- a checked and an unchecked model;
- a model new to the catalog after saving;
- a persona exception and an overridden persona model;
- an inherited model on a custom seat and on
delegate_task; - a project override.
- crews.md, agent-tools.md (
j5_propose_crew,j5_request_crew_member,delegate_task,j5_spawn_agent), and the persona docs' follow-up note on model allowlists are rewritten.
Out of scope
- Spending limits or cost reporting. The list chooses models; it doesn't promise savings.
- Persona model allowlists (roles.md). Personas keep their own routing.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
8 remaining items
feat(j5): choose which models custom Crew members can use (#757)