Skip to content

feat(personas): pick any signed-in provider for persona models - #391

Merged
bryantderosier merged 8 commits into
j5/mainfrom
j5/persona-any-provider
Oct 6, 2026
Merged

bryantderosier merged 8 commits into
j5/mainfrom
j5/persona-any-provider

Conversation

@bryantderosier

@bryantderosier bryantderosier commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

You can pick any signed-in provider for a persona's model now, not just Codex and Claude. A persona still only launches where the provider's sandbox enforces its runtime policy (#439), and the editor tells you which providers that is.

 persona route
-  driver: "codex" | "claudeAgent"
+  driver: any ProviderDriverKind
-  reasoning option id guessed from the driver
+  reasoning option id read from the model's own descriptor
                                        (reasoningEffort / effort / reasoning / variant / thinking)

 persona prompt
   persona instructions
-  "## Selected behavior … Never commit or push … Do not mutate PRs … Never merge"
   platform-tools note

 persona catalog (server → client)
+  policyEnforcement: [{ policy, drivers }]     # one table, ENFORCING_DRIVERS

 <AgentRoutePolicyFields> (web + mobile)
   Runtime policy select
+  "Sandboxed on Codex. Claude routes won't launch with this policy."
   Primary / Fallback model pickers            # every signed-in provider
  • 6dcbfdf (prompt-only fallback on providers that can't sandbox) is reverted. publish-only / diagnostic stay blocked, and Crew seats don't silently get Full access.
  • validateAgentPersonaAssignment requires exactly one reasoning option that matches the route.
  • Plain spawn_agent also picks up the shared reasoning-id helper, so reasoning / thinking models work there.
  • Full-access personas are Personas cannot run with full access outside a Crew seat #432 and stay out of this PR.

Evidence

Same models and policy on both sides (Workspace write, Claude primary, Codex fallback):

  • Before: Before: no sandbox note
    After: After: Sandboxed on Codex. Claude routes won't launch with this policy.

Tests:

validate(assignment with [{effort: high}, {reasoningEffort: low}])   before: passes as "high"   after: rejected
agentPersonaPolicyNote(read-only, [codex, claude])                  → "Sandboxed on Codex and Claude."
agentPersonaPolicyNote(read-only, [cursor, codex])                  → "… Cursor routes won't launch with this policy."
agentPersonaPolicyNote(publish-only, …)                             → "No provider can sandbox this policy yet …"
Crew override seat prompt                                           → no "Never commit or push."

vp test run over apps/server/src/j5/agents, CrewLaunchService, crewSeatRuntime, mcp/handlers and packages/client-runtime/src/j5 passes. tsc --noEmit is clean for contracts, client-runtime, server, web and mobile.

Merge Danger

Door: two-way

No migrations. Stored definitions and snapshots decode unchanged, and reverting puts the old picker and prompt rules back.

Blast Radius: clients

An older web, desktop or mobile build fails to decode the whole persona catalog once any persona is saved with a driver other than Codex or Claude. I'm accepting that and disclosing it here (@Jacksondr5, shout if you want a guard). New launches no longer get the appended rules, so personas that relied on them need those limits in their own instructions. Older servers send no policyEnforcement, so the editor just shows no note.

Claude Opus 5.5 via Claude Code

🤖 Generated with Claude Code

Persona routes were hard-coded to Codex and Claude in the contract, the
client picker, and the server's reasoning-option lookup. Routes now accept
any provider driver, and the reasoning option is read from the model's own
descriptors (reasoningEffort, effort, reasoning, variant, thinking). The
authority gate is unchanged, so providers that cannot enforce a persona's
runtime policy show the route as Blocked.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 5, 2026 5:55pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: Jacksondr5/j5code/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd315a97-c8c0-43f2-8e04-631b1d1d5fbb
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Sep 30, 2026
- Show the reasoning level in persona route labels for every provider's option id.
- Default new personas to Codex/Claude routes when one is signed in.
- Name a missing provider alongside an unenforceable policy, so a mistyped driver is visible.
- Reuse the shared reasoning option check in spawn_agent and the crew seat runtime.
- Test model selection and assignment validation with variant/reasoning/thinking ids.
- Narrow the user docs to providers whose models offer a reasoning setting.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

@Jacksondr5 replying here to your Teams message about this one too.

Yeah, I think you're right. I went back through the gate and it's actually worse than I made it sound in the description. workspace-write only launches on Codex right now, and diagnostic / publish-only don't launch anywhere. So even Claude gets blocked on any persona that writes. The policies are front and center, but mostly they just block stuff.

Between your two options I'd pick the same one you did. I think there's a decent middle though:

  • The authority policy is just instructions by default. The "never commit / don't touch PRs / never merge" rules already go into every persona's prompt no matter the provider.
  • If the adapter can actually enforce a sandbox (Codex, and Claude for read-only), we still add it on top.
  • If it can't, the persona launches in the thread's normal runtime mode. Crew seats already do this when you give them an explicit access mode (runtimeModeOverride), so it's mostly reusing that and not new machinery.
  • Instead of showing "Blocked", the persona shows a small "not sandboxed on this provider" note, so we're not overpromising anything.

I'll roll that into this PR so the picker and the launch behavior ship together. Lmk if you see a problem with that.

A persona whose runtime policy the provider can't sandbox used to show as
Blocked. Now it launches in the thread's normal runtime mode and the policy
reaches the agent as instructions only. Codex and Claude still get the real
sandbox where they support it. Settings marks those routes "not sandboxed on
this provider", and the Crew preview shows the seat's real access mode.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

@Jacksondr5 pushed this in 6dcbfdf. Personas launch on any signed-in provider now. If the provider can't sandbox the policy, it runs in the thread's normal mode with the policy as instructions, and Settings says "not sandboxed on this provider" on that route. Codex and Claude still get the sandbox where they support it. I updated the description to match.

@Jacksondr5

Copy link
Copy Markdown
Owner

Review panel: Claude Opus 5.5 (lead) + GPT-6.1-Sol

Both reviewers read c4f1cc3 independently and Sol tested it live on an isolated dev server with real Codex and Claude agents. 6dcbfdf landed after that: I have read its diff, and nobody on the panel has run it. Posting now, before a second test pass, because two decisions Jackson made today change the design that commit builds on.

Jackson's decisions, and what they mean for 6dcbfdf

Recorded in #439, with #432 linked from it:

  1. J5 does not try to enforce an unenforceable runtime policy with a prompt. A runtime policy means what the provider's sandbox enforces and nothing more.
  2. The rules appended to every persona's instructions come out ("Never commit or push", "Do not mutate pull requests", "Never merge a pull request"). They are hidden, and they override what the person wrote in the persona. What a persona should not do belongs in its own instructions.
  3. When someone builds a persona, the editor makes clear which providers can enforce which policy.
  4. A persona should be able to run with full access (Personas cannot run with full access outside a Crew seat #432). The shape is not chosen yet: Personas cannot run with full access outside a Crew seat #432 lists a full-access policy the persona declares, or an access mode chosen at launch.

6dcbfdf was pushed before #439 existed, and it goes the other way:

  • It makes the appended block the only restraint wherever the provider can't sandbox the policy, and adds a line to it (agentPersonaRuntime.ts:44, "Do not create, edit, or delete files.").
  • A persona labelled "Read only" on a provider with no sandbox runs in the thread's runtime mode, which the description says is Full access by default for spawns and delegates.
  • publish-only and diagnostic now launch everywhere. The bundled Publisher can really commit and push on Codex. Those two were blocked "pending the required operation boundaries"; unblocking them needs its own decision.
  • A Crew persona seat on a provider that can't sandbox its policy used to be refused until the person picked an access mode. It now resolves to Full access by itself.
  • "not sandboxed on this provider" appears on the route line in the persona list after saving. Nothing tells the person while they are building the persona.

What carries over: removing the Blocked dead end is right, and so are the wider picker and the shared reasoning-option helper. The way to get there is #432 (a persona states the access it runs with, on any provider) with #439 (no appended rules; the editor shows which providers sandbox which policy), instead of a sandbox policy that silently becomes a prompt.

Code findings, agreed by both reviewers (all still present at 6dcbfdf)

  1. The assignment check got looser (agentPersonaAssignment.ts:76). It takes the first option with any recognised reasoning id. A Codex assignment carrying [{effort: high}, {reasoningEffort: low}] passes as "high" while Codex runs at low; the merge-base rejects it. Sol reproduced this by running both versions of the function. Neither of us could reach it from a client, because the server builds these with one option and refuses client-authored assignments, so it is low severity. Checking the option id the model's own descriptor names would restore it.
  2. An older client loses the whole persona list. Decoding the PR server's real catalog with the merge-base schema fails outright once one persona has a non-Codex/Claude route (personas[n].editable.modelRoute[0].driver). You disclosed this; we confirmed it is the whole catalog, not just that persona. Worth a deliberate call from Jackson, since phones and desktop apps update on their own schedule.
  3. Dead fallback (agentPersonaRouting.ts:62, ?? "reasoningEffort"). It can't happen after the availability check; erroring would be clearer if a future caller breaks that.
  4. spawn_agent changes for non-persona spawns too (mcp/handlers.ts:301). It now accepts models whose reasoning select is reasoning or thinking. That is a fix, but it isn't in the description.
  5. The "Review focus" answer doesn't hold. CursorProvider sorts effort and reasoning at equal priority and dedupes by exact id, so nothing stops a model exposing both. Picker, routing and launch all take the same first one, so nothing breaks today.

From the lead only:

  • packages/client-runtime/src/j5/agentPersonas.ts:363 hard-codes Codex and Claude as the providers to prefer for a new persona. That is a second copy of the server's providerCanEnforceAgentPersonaAuthority; Personas: stop appending hidden commit and PR rules; show which providers enforce which policy #439 asks for the editor to read it from the server.
  • docs/user/personas.md:35 names Grok as an example. Grok's model on our host advertises no reasoning select, so it would not appear in the picker.
  • The description doesn't use the PR template: no checklist, tracking issue, or UI section.

Confirmed fine

  • Every touched file is J5-owned, including docs/operations/persona-library.md (created in feat(client): manage imported agents from Settings #85, absent upstream). No FORK.md entry or register entry is owed.
  • At c4f1cc3, persona launches from the composer, @persona, delegate_task and spawn_agent ran the declared model at the declared reasoning value under the right option id on both Codex (reasoningEffort) and Claude (effort). Settings create, edit and duplicate work in the browser.

Screenshots

Captured at c4f1cc3 against the merge-base, same data, viewport and theme. The provider order in the model menu flips from Codex, Claude to Claude, Codex, because the list is now sorted by label.

Before After
Before: Codex then Claude After: Claude then Codex

The other pairs (empty form, populated form, Codex and Claude model menus, reasoning menu) are under pr-391/ on j5/evidence and show no difference. The Blocked-state images there are out of date as of 6dcbfdf, and the "not sandboxed" note has no image yet. The description needs before/after images once the design settles.

Not tested

  • Anything in 6dcbfdf.
  • A real signed-in provider other than Codex and Claude: none is installed on the review host, so those routes were exercised only through hand-written YAML and unit tests.
  • Mobile and the desktop shell.

bryantderosier and others added 4 commits October 5, 2026 07:45
A launch must carry exactly one reasoning option matching the declared
route, and building a selection for a model with no reasoning select
now fails loudly instead of guessing an option id. Drops the Grok
example from the persona docs since its models advertise no reasoning
select.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Reverts 6dcbfdf. Jackson decided in #439 that a runtime policy means
only what the provider's sandbox enforces, so a persona no longer falls
back to prompt rules and the thread's runtime mode on providers that
can't sandbox its policy. Full-access personas are tracked in #432.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Per #439, a persona's own instructions are the whole behavior contract.
The no-commit, no-PR and no-merge lines J5 appended were invisible to
the author and could override what they wrote. Only the platform-tools
note remains. The authority rules table now records just the workspace
access each policy asks a sandbox for.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The persona catalog now carries the server's policy-to-driver table, so
the web and mobile editors say under Runtime policy where the selected
policy is sandboxed and which chosen routes won't launch with it. New
personas default to a route on a sandboxing provider from that table
instead of a hard-coded Codex/Claude preference. Older servers send no
table and the editor shows nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

@Jacksondr5 thanks, this was a really useful pass. I reworked the PR around #439 so it lines up with your call instead of fighting it.

  • 6dcbfdf is reverted (06a6e18). No more prompt-only fallback. A persona launches only where the provider's sandbox enforces its policy, so publish-only and diagnostic are blocked again and Crew seats don't quietly end up on Full access.
  • The appended rules are gone (355e687). The "never commit / no PRs / never merge" block doesn't get tacked onto persona prompts anymore. The persona's own instructions are the whole contract, and only the platform-tools note is still added.
  • The editor says which providers sandbox the policy (70f1240). The server sends the table with the catalog, and the web and mobile editors show it under Runtime policy, e.g. "Sandboxed on Codex. Claude routes won't launch with this policy." That also replaces the hard-coded Codex/Claude preference in agentPersonas.ts you flagged.
  • Personas cannot run with full access outside a Crew seat #432 (full access) stays a follow-up, since its shape isn't picked yet.

On the code findings:

  1. Assignment check: fixed in 2939fd9. A selection has to carry exactly one reasoning option and it has to match the route, so [{effort: high}, {reasoningEffort: low}] gets rejected now. The validator doesn't have the provider's descriptors, so I went with "exactly one" rather than reading the descriptor id. It closes the same hole.
  2. Older clients losing the catalog: I'm accepting this one and called it out in the description. It only bites someone on an old client who's also saved a persona on a new provider, and updating fixes it. Shout if you'd rather I guard it.
  3. Dead fallback: it throws now (2939fd9).
  4. spawn_agent change: added to the description.
  5. Review focus: yep, you're right, I got that wrong. Corrected in the description.

Grok's gone from the docs example, the description uses the template now, and there are fresh before/after screenshots in it.

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review panel, round 2: Claude Opus 5.5 (lead) + GPT-6.1-Sol

Reviewed at 70f1240. Sol re-tested live on an isolated server with real Codex and Claude agents; I read the four new commits. Both reviewers agree: the rework does what #439 asked and the earlier findings are closed. Approving.

Decision from Jackson (2026-10-05): the older-client limitation is accepted as described. There are no mobile users yet, and telling people to update is fine. No guard needed.

Verified live

  • Nothing launches without a sandbox. A Cursor read-only persona, a Claude workspace-write persona, and diagnostic and publish-only on Codex all show Blocked, are absent from the composer picker, and are refused from direct launch, delegate_task, @persona and spawn_agent. Crew seats for all four are refused at preview and approval with "Nothing was spawned"; none became Full access. The revert left nothing behind: diffing 06a6e18 against the parent of 6dcbfdf shows only the files 2939fd9 also changed.
  • The appended rules are gone. Sol captured what each provider actually received (Codex developer instructions, Claude appended system prompt): the persona's own text and the platform-tools note, with no "Selected behavior" block and no commit, PR or file rules. Same for an untouched bundled Scout.
  • The sandbox is what restrains a persona. A workspace-write persona on Codex told to commit tried git add and git commit; both failed with a read-only .git/index.lock, and the agent reported the error.
  • The editor text matches what launches, for every policy, in create and edit, and updates as the policy or routes change. It is visible before saving.
  • Finding 1: [{effort: high}, {reasoningEffort: low}] is rejected for both providers; single-option assignments pass; a Crew seat with a model override, a fork of a persona thread, and a persona thread from before the change all still run.
  • Settings create, edit and duplicate, and composer launches on both providers at the declared model and high reasoning. 179 focused tests pass.

Small things, not blocking

  1. docs/j5/product/agent-personas/index.md:175 says the platform-tools note is "the only addition". agentPersonaRuntime.ts:53-59 also appends the handoff-artifacts section for a persona that declares artifacts, and it is in the real Scout payload. Given what #439 is about, the doc should name both.
  2. docs/user/personas.md:35 says the editor "names any chosen model whose provider can't sandbox it". It names the provider ("Claude routes won't launch with this policy"), not the model.
  3. The assignment check now requires exactly one reasoning option but not that its id is the one the model advertises, so Codex [{effort: high}] passes. No launch path builds that, and real threads carried the right id. Fine as is; noting it so nobody relies on the check for more than it does.

Screenshots

The two in the description load and match the head. These cover the states they miss:

State Image
Workspace write with a Claude route Workspace write warns for a Claude route
Read only Read only is sandboxed on Codex and Claude
Publish only Publish only cannot launch
Saved persona, Blocked reason Blocked hover for a Claude write persona

The other policies are under pr-391/ on j5/evidence with the r2-policy- prefix.

Not tested

  • A real signed-in provider other than Codex and Claude; none is installed on the review host. Those routes were exercised with hand-written YAML and unit tests, and spawn_agent to Cursor stopped at "provider unavailable" before reaching the policy check.
  • Mobile was read, not run: it calls the same helpers and renders the same note. The desktop shell and remote connections were not run.
  • The older-client failure was reproduced by decoding the real catalog with the old schema, not with an old build.

…the provider the editor names

The agent-personas doc said the platform-tools note was the only addition, but a
persona that declares handoff artifacts also gets the artifact-path section. The
user doc said the editor names the model whose provider can't sandbox a policy; it
names the provider.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review panel (Claude Opus 5.5 lead): re-approving at 0f0f06b. The one commit since the last approval changes a sentence in each of docs/j5/product/agent-personas/index.md and docs/user/personas.md, no code. Both now match the behaviour: the product definition names the platform-tools note and the handoff-artifacts section as the two additions to a persona's instructions, and the user doc says the editor names the provider. That closes notes 1 and 2 from the round 2 review. #469 is stacked on this branch and will be reviewed as one stack with it.

@bryantderosier
bryantderosier merged commit 9745f1b into j5/main Oct 6, 2026
37 checks passed
@bryantderosier
bryantderosier deleted the j5/persona-any-provider branch October 6, 2026 12:50

This branch was successfully deployed

1 active deployment
Preview — 0f0f06b1 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants