Skip to content

feat(j5): a blocked persona escalates, and the Owner can allow it once - #937

Merged
Jacksondr5 merged 23 commits into
feat/crew-seat-replacementfrom
feat/persona-escalation-allow-once
Nov 8, 2026
Merged

Jacksondr5 merged 23 commits into
feat/crew-seat-replacementfrom
feat/persona-escalation-allow-once

Conversation

@bryantderosier

@bryantderosier bryantderosier commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a persona couldn't start, it failed with a vague reason, or the agent quietly recreated it as a custom worker to get past its model or access limits. That defeats the point of the persona. And when I wanted to let it run anyway, there was no one-time way to say yes. Now a blocked persona stays blocked, says exactly why, escalates to me, and an Owner can answer Allow this once. Closes #785.

  • Six codes, the same everywhere. delegate_task, j5_spawn_agent, Crew seats and additions all refuse with library_empty, persona_not_found, persona_disabled, persona_invalid (with the repair message), models_exhausted (one reason per entry, including Personas: agents pick personas, and who picked sets the limits #781's limits), or library_unreadable, all through one text helper (personaBlockText). J5's own tools return the code as the failure code. delegate_task's codes are upstream's fixed list, so there the code leads the message as [code], and I didn't edit upstream's list.

  • The agent pick works per entry. Models for custom members and the caller's access are now checked per entry inside routing, so a pick moves on past an entry it can't use. Each candidate records every limit it fails, which is how the server knows whether lifting one limit lets some entry run. A pin is a list of one: a pinned model that can't run is refused and never falls back.

  • Escalation. Every refused launch an agent made gets a row in j5_persona_escalation (migration 053), and the refusal carries escalation_id. A Crew member tells its Captain. The Captain, or any caller outside a Crew, asks me with j5_send_message and escalation_id. The server accepts the caller's own escalations, or its Crew members' for a Captain, and the Inbox shows the server's own record of the block in a separate Recorded by J5 panel, carried as data so the agent's text can't hide or fake it. The ask must be fresh: one that would join an ask already open with that person is refused. Outside agents can't ask, so they get the code and reasons but no row.

  • Allow this once. If one limit stood in the way (model-not-eligible or access-above-caller), the ask shows an Allow this once button to Owners, in the web/desktop Inbox and in the Captain's AdjudicationDock. It goes through a new Owner-scoped RPC (j5.inbox.allowPersonaOnce, AuthSettingsWriteScope plus requireOwner), answers the ask with a fixed reply, and marks the escalation granted. A text reply never grants anything. The agent retries with allow_once on any of the four launch tools. That's accepted only if the grant is unused, for the same caller and persona, and the launch passes with just that limit lifted. It records pickSource: { kind: "allow-once", waived }, and the grant is spent just before the worker is created. It covers one launch attempt: if that attempt fails, the agent escalates again, and the next launch meets the limits again. A provider that can't enforce the persona's access is never waivable.

  • Guidance. The standing instructions and the four launch tool descriptions say never to recreate a blocked persona as a custom worker, how to escalate (as a fresh ask), and how to retry.

  • Playbooks (second commit). The playbook staffing rule used to propose a custom seat for a persona that was missing, disabled or blocked. Now a stand-in is only for a persona this server doesn't have. A disabled, invalid or blocked persona keeps its steps with the Captain, who escalates it. Bryant picked that option.

  • Review fixes from Tyler's review. A retried Allow this once replays and succeeds, and its fixed reply names the agent that must retry, so a Captain knows to pass the id to its member. The dock's button resets per ask. The button's wording lives in client-runtime. The j5_request_crew_member description now says a failed launch spends its allow_once. An escalation ask can't join an ask already open (freshAsk on A2ASendService.send). J5's record now shows in its own J5RecordPanel rather than being appended to the agent's Markdown.

  • Fixes from Jackson's panel review. A grant now covers only what the refusal showed: the definition it was refused under, and the model entries it unlocks with their access. So a retry can't pin a different unchecked model, ask for broader access, or use a grant after the persona changed, and a mismatch leaves the grant unspent. A grant matches the exact entry, reasoning level included. A Crew seat naming an invalid persona now gets persona_invalid with its repair message instead of "not in the library", and the refusal is recorded so the Captain's ask carries J5's record.

  • Earlier fixes (third to sixth commits). The sixth rewrites one ??= in the button, which React Compiler can't compile; CI's coverage test caught it. The refusal text says Allow this once is a button and that a typed reply grants nothing; a live agent had asked me to type it. The guidance bullet also moved next to the rules for asking the person, keeping its note to clear or settle an ask already open (fifth commit).

pick refused ─ code + reasons ─ escalation row (agent callers) ─ escalation_id
   member ──▶ Captain ──▶ j5_send_message(expect_reply, escalation_id) ──▶ Inbox / dock
                                                     (J5's record shown apart, as data)
   Owner: Allow this once ──▶ fixed reply + granted
   agent: retry with allow_once ──▶ launch past one limit ──▶ pickSource allow-once, grant used

Live testing

Pass, at 346c2a9, on a setup-agent-live-test.ts home (no flags), with 3 Claude Haiku 5.5 turns.

  • Live: in a new Supervised thread I asked in plain words, without @persona:, for the haiku-helper persona (Full access) to say hello as a subagent. The agent's delegate_task was refused: both entries would run with Full access, above its Supervised access. It said it wouldn't get around that with a plain child or custom worker, and it asked me with the escalation_id. The Inbox item showed J5's own record of the block and Allow this once. I pressed it as the Owner. The ask closed with the fixed reply, the agent retried with allow_once, and the persona ran once and said hello. In the test home's database, the child's assignment has pickSource: { kind: "allow-once", waived: "access-above-caller" }, and the escalation row is used.
  • Found and fixed: in that run, the agent told me to reply "Allow this once" in words, which grants nothing. 346c2a9 makes the refusal say it's a button on the ask, and that a typed reply never allows it. That text change wasn't re-run live.
  • Head is fc82748, restacked onto feat(j5): a Captain can replace a crew seat #935. The only changes after the tested commit move the blocked-persona bullet within the standing instructions, restore its note about an ask already open, and rewrite one ??= in the button for React Compiler, and I didn't re-test that live because the turn budget was spent. The evals below cover it.
  • Not live: the Captain's dock button. It needs a Captain with a live Crew, which was more turns than I had budgeted. It's the same component as the Inbox button, reading the same item.

Evidence

  • New tests:
    • agentPersonaLibrary.test.ts, "tells the six reasons apart, each with its own code": all six codes with their text, including the repair message for an invalid definition.
    • agentInvocation.test.ts, "escalates an agent's blocked pick, and the Owner's grant lets one launch through": delegate_task refused with [models_exhausted] and an id; the retry is refused before the grant ("never a text reply"); after the grant it launches with pickSource: allow-once; the same id again says "already used"; a fresh launch is refused again.
    • agentPersonaRouting.test.ts: "offers one waiver only where lifting that limit alone lets an entry run" (two failed limits means no waiver) and "never lets a grant put a persona on a driver that can't enforce its access".
    • agentPersonaPick.test.ts, "a pinned entry that can't run escalates instead of falling back".
    • agentPersonaEscalation.test.ts: a Captain can ask about its member's escalation and another Captain can't; a grant is bound to its caller and persona and is used once; an escalation with no single waiver can't be granted.
    • ClientActionsService.test.ts, "allows a blocked persona once": the fixed reply, then granted; a second press, or one on an unwaivable escalation, answers nothing.
    • CrewLaunchService.test.ts, "a Captain's blocked persona seat escalates, and its grant launches that seat once".
    • ClientReadsService.test.ts, "puts an escalation only on the ask that carries it": of two open asks, only the linked one carries escalation.
    • handlers.test.ts: j5_spawn_agent returns persona_not_found as its code, and an ask with escalation_id carries the server's record.
    • Permission tests: clientRpcPermissions.test.ts and wsRpc.test.ts list the new method as Owner-only.
  • Evals: the Sonnet 5.5 mcp-tool-use orchestration cases on base (d8847f6) and head (10ec2d2; 5acb8d4 only restores a clause the first head run already covered).
    • Base passed 96% of 67 samples. Head passed 90% of 67.
    • The cases that dipped on head failed on identical input too:
      • With my instruction text reverted, the first request is byte-identical to base, and head still failed delegates-then-new-thread-with-model 2 of 6.
      • Run side by side at 6 samples, that case was 3/6 on both, and thread-mention-without-link-after-read was 4/6 on head against 5/6 on base.
      • opus-review-too-via-delegate is a known flake and failed on both.
    • About $15.62 in total, including the bisect.
  • Final eval after the restack, on 0d6b550: 94% of 68 samples, $4.11. Every case passed every sample except two known ones: delegates-then-new-thread-with-model (1/3, the variance shown above) and opus-review-too-via-delegate (1/3, the known flake).
    node --env-file-if-exists=../.env mcp-tool-use/run.ts --cases mcp-tool-use/cases/orchestration.jsonl --out runs/<name> (from evals/)
  • vp run check:changed: format, lint, knip, typecheck (32 packages) and tests (46 files, 609 tests) all pass.

Not verified:

  • No guard eval case for "a blocked persona isn't recreated as a custom worker". Upstream's mcp-tool-use harness offers no J5 tools, so the case can't be written there. That's Evals: a J5-owned suite that offers J5's tools #936.
  • The dock button wasn't run live (see Live testing).
  • The review fixes (the replay-safe grant, the fresh-ask rule and the J5 record panel) are covered by unit and browser tests and weren't re-run live. They're covered by the final eval run on 0d6b550 below.
  • Mobile shows the ask without the button, by design. I didn't run it on a device.

UI changes

A new Allow this once button next to Answer, in the Inbox item and the Captain's dock. It only shows for an Owner on an ask carrying a waivable, still-open escalation.

Captured at 1280x800 on the live test above (346c2a9), as the Owner:

Before After
Inbox ask with Allow this once new Inbox ask with Allow this once, after
Thread after Allow this once: the retry launched new Thread after Allow this once: the retry launched, after

The Captain's dock button wasn't captured (see Live testing).

Merge Danger

Door: two-way. Migration 053 only adds a table; a revert leaves the table and any escalation rows behind unused. pickSource: allow-once was already in the contract (#781).

Blast Radius: every persona launch path (delegate_task, j5_spawn_agent, Crew seats) and the Inbox and dock answer row. If the per-entry limits are wrong, an agent's persona pick could be refused or allowed wrongly. The refusal texts changed, so anything matching old strings would break.

After merge: nothing.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: before/after screenshots above, and a video for motion or interaction (new button, so after only; no motion; dock not captured)
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR (none touched)
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md (none)
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md)
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them

Surfaces walked:

  • Entry points: the four agent launch tools and j5_send_message; the button in the Inbox and the dock. The composer launch gets the codes too, with no escalation, since a person sees the error directly.
  • Clients: web and desktop get the button. Mobile shows the ask but has no button.
  • Providers: the check is provider-independent. Driver capability stays unwaivable.
  • Contracts: an optional escalation on HumanInboxItem, the six block codes, the access-above-caller route failure code, and the new action RPC.
  • Reverse states: a grant is single-use and nothing is ever edited on the persona, so there's nothing to undo. An unanswered ask can still be answered in text or withdrawn.
  • Connection modes: the grant is server-side and the button uses the guarded RPC.

Made with Claude Opus 5.5 in Claude Code (J5 Code).

🤖 Generated with Claude Code

@bryantderosier bryantderosier added the enhancement New feature or request label Nov 6, 2026
@bryantderosier bryantderosier self-assigned this Nov 6, 2026
@vercel

vercel Bot commented Nov 6, 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 Nov 7, 2026 11:19pm UTC

Request Review

bryantderosier added a commit that referenced this pull request Nov 6, 2026
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Nov 6, 2026
@bryantderosier
bryantderosier added this pull request to stack #933 November 6, 2026 17:32
@github-actions github-actions Bot added the size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). label Nov 6, 2026
@bryantderosier
bryantderosier marked this pull request as ready for review November 6, 2026 18:24
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 68 billable files and costs up to $17.00.

Or wait 45 seconds for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 488c697 and 06f794d.

Files selected for processing: 68

  • apps/mobile/src/j5/inbox/InboxScreen.tsx
  • apps/server/src/j5/a2a/AgentCaller.ts
  • apps/server/src/j5/a2a/AgentCrewProposalService.ts
  • apps/server/src/j5/a2a/ClientActionsService.test.ts
  • apps/server/src/j5/a2a/ClientActionsService.ts
  • apps/server/src/j5/a2a/ClientReadsService.test.ts
  • apps/server/src/j5/a2a/ClientReadsService.ts
  • apps/server/src/j5/a2a/CrewLaunchService.test.ts
  • apps/server/src/j5/a2a/CrewLaunchService.ts
  • apps/server/src/j5/a2a/CrewProposalService.test.ts
  • apps/server/src/j5/a2a/CrewProposalService.ts
  • apps/server/src/j5/a2a/Migrations.test.ts
  • apps/server/src/j5/a2a/Migrations.ts
  • apps/server/src/j5/a2a/SpawnAgentService.ts
  • apps/server/src/j5/a2a/clientActionRpc.ts
  • apps/server/src/j5/a2a/clientReadRpc.test.ts
  • apps/server/src/j5/a2a/contracts.ts
  • apps/server/src/j5/a2a/mcp/handlers.test.ts
  • apps/server/src/j5/a2a/mcp/handlers.ts
  • apps/server/src/j5/a2a/mcp/orchestratorSurface.test.ts
  • apps/server/src/j5/a2a/mcp/outsideAgent.test.ts
  • apps/server/src/j5/a2a/mcp/registration.test.ts
  • apps/server/src/j5/a2a/mcp/tools.ts
  • apps/server/src/j5/a2a/migrations/054_PersonaEscalations.ts
  • apps/server/src/j5/a2a/runtimeLayer.ts
  • apps/server/src/j5/a2a/spawnWorkspace.test.ts
  • apps/server/src/j5/agents/agentDelegation.ts
  • apps/server/src/j5/agents/agentInvocation.test.ts
  • apps/server/src/j5/agents/agentInvocation.ts
  • apps/server/src/j5/agents/agentPersonaEscalation.test.ts
  • apps/server/src/j5/agents/agentPersonaEscalation.ts
  • apps/server/src/j5/agents/agentPersonaLaunch.integration.test.ts
  • apps/server/src/j5/agents/agentPersonaLaunch.ts
  • apps/server/src/j5/agents/agentPersonaLibrary.test.ts
  • apps/server/src/j5/agents/agentPersonaLibrary.ts
  • apps/server/src/j5/agents/agentPersonaOrchestration.ts
  • apps/server/src/j5/agents/agentPersonaPick.test.ts
  • apps/server/src/j5/agents/agentPersonaPick.ts
  • apps/server/src/j5/agents/agentPersonaRouting.test.ts
  • apps/server/src/j5/agents/agentPersonaRouting.ts
  • apps/server/src/j5/agents/agentPersonaRpc.ts
  • apps/server/src/j5/agents/agentPersonaSpawn.ts
  • apps/server/src/j5/agents/agentSubagent.integration.test.ts
  • apps/server/src/j5/sharing/connectionWriter.ts
  • apps/server/src/j5/test-support/agentPersonaEscalations.ts
  • apps/server/src/j5/wsRpc.test.ts
  • apps/web/src/j5/a2a/AdjudicationDock.tsx
  • apps/web/src/j5/a2a/AllowPersonaOnceButton.tsx
  • apps/web/src/j5/a2a/HumanInboxPage.tsx
  • apps/web/src/j5/a2a/J5RecordPanel.browser.test.tsx
  • apps/web/src/j5/a2a/J5RecordPanel.tsx
  • apps/web/src/j5/a2a/humanInboxClient.ts
  • docs/j5/product/a2a/agent-tools.md
  • docs/j5/product/agent-personas/index.md
  • docs/j5/product/features/crews.md
  • docs/j5/product/features/inbox.md
  • docs/j5/product/features/playbooks.md
  • docs/j5/user/personas.md
  • docs/j5/user/playbooks.md
  • packages/client-runtime/src/j5/agentPersonas.ts
  • packages/client-runtime/src/j5/state.ts
  • packages/contracts/src/j5.ts
  • packages/contracts/src/j5/agentPersona.ts
  • packages/contracts/src/j5/clientRpcPermissions.test.ts
  • packages/contracts/src/j5/clientRpcPermissions.ts
  • packages/provider-core/src/j5/orchestrationInstructions.ts
  • packages/provider-core/src/j5/playbookInstructions.test.ts
  • packages/provider-core/src/j5/playbookInstructions.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@tyler-barton-horizon tyler-barton-horizon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated review of this layer of stack pingdotgg#933 (diff against its base branch). Findings were not individually verified against the source, so please treat them as likely issues and push back on any that are wrong.

Mobile Inbox (apps/mobile/src/j5/inbox/InboxScreen.tsx, not in this diff): 'Allow this once' is added only on web. An Owner on mobile sees the escalation ask with only a text reply, and the tool text says a typed reply never allows it, so the agent stays blocked until the Owner opens web or desktop (AGENTS.md 'Hit every surface').

🤖 Generated with Claude Code

);

/** A seat let past its limit once spends that allowance as it launches. */
const spendAllowances = (resolved: ReadonlyArray<ResolvedCrewLaunchSeat>) =>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

spendAllowances marks every allow_once grant 'used' before anything is recorded or reserved, and nothing restores it if the launch fails.

A Captain calls j5_request_crew_member with allow_once, and the seat cap or replaceSeat fails after spendAllowances ran. The escalation is now 'used', contrary to the tool's 'If the new member fails to launch, nothing changes'. On retry grantedWaiver refuses with 'already used', so the forward-only recovery crewProposalNextStep suggests can't work. With two seats in one batch, the first seat's grant is spent even if the second fails.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch on the wording, but spending it up front is on purpose: an allowance covers one launch attempt, and if that attempt fails the agent asks again (that's in the persona contract now). I added that exception to the j5_request_crew_member description in 41fd6ce so it doesn't say "nothing changes" anymore.

}).pipe(Effect.mapError(refused));
if (assignment.pickSource?.kind === "allow-once")
yield* (yield* AgentPersonaEscalations)
.use(input.allowOnce!)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

invokeAgent spends the allow_once grant before service.delegateTask runs.

If delegateTask fails (worktree error, provider failure), a retry is refused in grantedWaiver with 'already used; each allowance covers one launch', and the agent has to escalate to the Owner again for a launch that never happened.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same as the Crew one, this is by design. Allow this once covers a single attempt, so a delegate that fails after it's spent comes back to me. I'm keeping it simple instead of rolling grants back.

blockCode: "models_exhausted",
});
}
if (agentPick)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(Refers to line 670, which is outside the diff.)

On a persona seat with a frozen model_selection, an agent pick never reads seat.allowOnce and never records an escalation.

This path skips pickAgentPersona and calls assertWithinCallerAccess directly. The error has no code, so it becomes a plain stateError with no escalation_id, and the grant is never applied. The same goes for resolveSelection's CrewLaunchModelNotEligibleError, so the Owner's grant can't help this seat.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That path only runs for a persona seat whose runtime the person set on the roster card. Agents can't set model_selection or runtime_mode on a persona seat (CrewProposalService refuses it with "only the human can override its runtime"). A person's pick has no limits to waive, so there's nothing to escalate there, and the access assert on that path is belt and braces.

? yield* send()
: yield* sendClaimingAttachments(receiverThreadId, attachments, send);
if (escalationId !== undefined && result.exchangeId !== null)
yield* (yield* AgentPersonaEscalations).linkAsk({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

linkAsk runs after the message is sent and overwrites exchange_id (UNIQUE) with no check, so a link failure is reported as a failed send of a delivered message.

A follow-up on existing exchange X carrying a different escalation_id violates UNIQUE(exchange_id). The tool returns a SqlError though the ask was delivered, and the agent's retry with a new client_request_id duplicates the ask. Re-linking an escalation to a new ask also quietly removes the Allow button from the earlier, still-open ask.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A follow-up to a person is refused before anything's sent, so an escalation always links to a brand-new exchange and the unique index can't collide. Re-linking only happens after the earlier ask is closed. The everyone-here corner moves the button to the newest ask, and I'm fine with that. I also made the fresh ask explicit in 6a388cc: an ask with escalation_id that would join an ask already open is refused before anything is written.

@bryantderosier

Copy link
Copy Markdown
Collaborator Author

On the mobile point in the review summary: Allow this once is web and desktop only for now. We decided that for #785, and the docs say mobile shows the ask without the button. As of 83e250d, mobile does show J5's own record of the block as plain text under the ask. The button can follow if it's missed.

@bryantderosier
bryantderosier force-pushed the feat/persona-escalation-allow-once branch from 83e250d to 0d6b550 Compare November 6, 2026 23:30
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Restacked onto #935's head (9068716); no changes beyond fitting the lower layers' review fixes. The one fitting commit, 0d6b550, keeps #931's unchecked-model refusal for a persona seat and adds the block code to it.

@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Restacked onto #935's head (ba02033) and fixed the panel's grant-binding and invalid-persona findings (0b0a624, bb486cc).

@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Restacked onto #935's head (6fe827f); fixed the panel's exact-entry grant scope and preflight escalation (5014328, fc82748).

@bryantderosier
bryantderosier force-pushed the feat/persona-escalation-allow-once branch from bb486cc to fc82748 Compare November 7, 2026 01:00
bryantderosier and others added 22 commits November 7, 2026 17:56
The playbook staffing guidance told a Captain to propose a custom seat for a
persona that was missing, disabled or blocked, which recreates a blocked
persona as a custom worker. A stand-in seat is now only for a persona the
server doesn't have; a disabled, invalid or blocked persona keeps its steps
with the Captain, who escalates it. The j5_propose_crew description and the
docs say the same.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a live run, a Haiku agent told the person to reply "Allow this once" in
words, which grants nothing. The refusal now says an Owner allows it with a
button on the ask, and that a typed reply never does.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule that a refused persona escalates moves from the top of the delegation
section to the end of the messaging section, beside the rules for asking the
person, and the persona invocation text keeps its original "report it instead
of working around it". No behavior change; a smaller change to the standing
instructions.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moving the blocked-persona rule dropped its note that the ask must come after
clearing or settling any ask already open with the person. The server refuses
a second open ask from the same agent, so the note is back.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React Compiler doesn't support logical assignment, so it skipped the button and
the coverage test failed. The request id is assigned without `??=`.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two open asks, one linked to a persona escalation: only that item carries
`escalation`, with its persona, waivable limit and status.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The grant is spent just before the worker is created, so it covers one launch
attempt; if that attempt fails, the agent escalates again. The persona contract,
the Inbox definition and the user guide say so instead of implying the grant
lasts until a worker exists.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….Service

Drops the standalone AgentPersonaEscalationsShape for the effect-services
convention; its methods are typed as AgentPersonaEscalations["Service"].

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retried grant whose reply was lost was refused as "already allowed once".
Now an already granted escalation replays the same answer by its command id
and succeeds, while a different press is refused by the answered ask, so a
grant interrupted between its two writes is finished by the same retry.

The fixed reply named no one, so a Captain that asked for its member was told
to retry a grant only the member can use. It now names the agent whose launch
was refused and tells a Captain to pass the id on; the guidance says the same.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dock reused one button as the shown ask changed, so an error and a pending
request id from one ask carried to the next. It is keyed by exchange now.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The button's wording for each limit moves next to ROUTE_FAILURE_TEXT as
ALLOW_ONCE_LIFTS, so every client shares it. The server's text stays separate
because it is written for the agent.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_once

The description said nothing changes when the new member fails to launch, but
an allow_once it used covers that one attempt and is spent.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A2ASendService.send takes freshAsk: an ask that would join one already open
with the receiver is refused before anything is written, telling the agent to
clear or settle the open ask first. j5_send_message sets it whenever
escalation_id is passed, so the guidance's "fresh ask" is enforced.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The escalation summary was appended to the agent's ask, which the Inbox renders
as Markdown with raw HTML, so an unclosed fence or a <details> in the agent's
text could hide it, swallow it, or fake one. The summary is now data on the
Inbox item's escalation view, never part of the message, and shows in a
"Recorded by J5" panel (J5RecordPanel, plain text) in the Inbox and the
Captain's dock, and as plain text under the ask on mobile.

The service's askSummary becomes authorizeAsk, which only checks who may ask.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the restack, a Crew persona seat whose entries are all unchecked is
refused as CrewLaunchModelNotEligibleError again, as #931's review made it,
and the error carries the persona's block code so j5_propose_crew and
j5_request_crew_member still return models_exhausted with the escalation.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A grant was checked against the caller and persona only, so a retry under the
same escalation could pin a different unchecked model or ask a Crew seat for
broader access than the refusal showed. The escalation now records its scope:
the persona's definition digest, and each candidate the waiver lets run, by
entry index, provider instance and model, with the access it would get. A
retry is waived only for those candidates, only at no more than that access,
and only while the definition is unchanged; anything else is refused and the
grant stays unspent.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crew prevalidation knew only missing and disabled personas, so a seat naming a
persona whose definition is invalid was told it wasn't in the library, with no
code and no repair message. The check now uses the same definition lookup as
a launch, refusing with the shared code (persona_not_found, persona_disabled,
persona_invalid with its repair message, library_empty) in the same text form.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…luded

A grant's scope matched candidates on instance and model only, so a grant for
one entry also covered the same model at another reasoning level. The scope
now records each candidate's effective options, the level a pin chose among
them where the entry leaves it to the spawner, and a retry is covered only by
an entry with the same instance, model and options.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Crew preflight refused a missing, disabled or invalid persona without an
escalation, so the Captain's ask about it carried no record from J5. It now
records one, never waivable, and returns its escalation_id, so the ask shows
the Recorded by J5 panel with no Allow button. A card the person reviews
records nothing.

Built with Claude Opus 5.5 in Claude Code (J5 Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #924 an ask to a person always opens its own exchange, so freshAsk and
A2AOpenAskExistsError have nothing left to refuse and go. What can still put
an escalation on the wrong Inbox item is a regarding follow-up, so
j5_send_message refuses escalation_id with regarding and says to open a new
ask with expect_reply, intent and urgency. The guidance, the refusal text and
the docs drop "fresh ask" for the same rule.

The web Inbox page shows the Recorded by J5 panel before the follow-ups, as
the dock and mobile do, and the escalation test support imports migration 54.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With several asks open to a person, a second ask with the same escalation_id
moved J5's record and the Allow this once button off the ask that opened the
Inbox item. authorizeAsk now refuses an escalation whose ask is still open,
naming that ask and the two ways out: follow up there with regarding, or
clear it and ask again. Once the ask closes a new one may carry it.

A regarding follow-up to the ask the escalation already sits on drops the id
and goes as an ordinary follow-up, since nothing moves; a follow-up to any
other ask is still refused. The escalation test support runs the a2a
migrations, which the open-ask read needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…viders

The Recorded by J5 panel said Allow this once "would let one launch attempt
past a model Models for custom members doesn't check". It now says the launch
would use a model that Models for custom members doesn't allow, or run with
broader access than the agent that started it. A refused persona's reasons
name each entry's provider as the app does (its instance's name, else Codex
or Claude) instead of its raw id, using the providers the launch already read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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.

Approved as part of the persona stack (#931 → #938), reviewed and live-tested as one unit. Details on #938.

@Jacksondr5
Jacksondr5 merged commit 950b198 into j5/main Nov 8, 2026
56 of 68 checks passed
@Jacksondr5
Jacksondr5 deleted the feat/persona-escalation-allow-once branch November 8, 2026 02:15

This branch was successfully deployed

1 active deployment
Preview — 06f794de Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Personas: a blocked persona escalates, and I can allow it once

3 participants