Skip to content

feat(j5): an outside agent can message, start and stop agents - #560

Merged
Jacksondr5 merged 1 commit into
j5code/remote-steer-519from
j5code/outside-agents-498
Oct 12, 2026
Merged

Jacksondr5 merged 1 commit into
j5code/remote-steer-519from
j5code/outside-agents-498

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Problem

An agent signed in from outside the app (Claude Code or Codex in a terminal, ChatGPT, a bot) could read the fleet on J5 but could not message, start or stop an agent. Upstream's docs promise all three, and J5 hides upstream's own send and launch tools. Closes #498.

Top of a stack: #557, then #563, then this. Review this PR's own single commit.

What changed

An outside agent gets an identity in J5's ledger, one per sign-in: outside:<session id>, shown by the label the client registered. The design and each decision are in #498 (Jackson, 2026-10-11).

  • Messaging. j5_send_message accepts an outside agent. It sends plain messages to agents on this server only. Nothing can be delivered to it, so asks, replies and messages addressed to it are refused, each with the legal move named. Its message is recorded in the receiver's project, and the envelope tells the receiving agent who sent it and that j5_send_message cannot reply to it.
  • Starting an agent. j5_spawn_agent accepts an outside agent that names a project, or asks for none. The new agent sits at the top level of its project with the outside agent as its spawner.
  • Listing and stopping. j5_list_participants (with a project_id) and j5_stop_agent accept an outside agent.
  • The cap. The approved sign-in level limits every send (one that asks for no steer or restart included), every stop and every spawn (a persona included). A send is checked when it is sent, so a message already waiting still lands if the receiver's modes are raised, or the sign-in revoked, before delivery. Whether to check again at delivery is an open question for Jackson.
  • In-app agents. Their checks are unchanged, with two exceptions: delegate_task now also requires the orchestration capability (every thread session has it), and listing a project that has no agent threads yet returns an empty listing where it returned an error.
  • Refusals. Crews, playbook tools, delegate_task, j5_stop_crew, j5_archive_crew and j5_clear_own_ask tell an outside agent to start an agent and brief it. One helper makes that refusal for every thread-only tool.
  • Clients. On web, the thread card, the "Spawned by" line and the Fleet row name the outside agent. Mobile renders no agent-to-agent cards and has no Fleet page, so nothing changes there.

A new table, j5_a2a_outside_agent (ledger migration 33), keeps each outside agent's label for the envelope and the clients.

UI changes

Web only, captured at 1280×800 on the live-test servers. Every state is new: on the base (#557) an outside agent's send and spawn are refused, so there is no "before" to show.

Before After
Outside-agent message card new Outside-agent message card, after
Outside-agent message queued behind a held turn new Outside-agent message queued behind a held turn, after
Outside agent named in Spawned by new Outside agent named in Spawned by, after
Outside agent named in Fleet new Outside agent named in Fleet, after
Fleet hover shows the full outside-agent label new Fleet hover shows the full outside-agent label, after

No video was captured in this pass, so the shots do not show the queued row turning into a delivered card.

Live testing

Pass, at 25b8bee1a3 against base af1d67b344, by a Peer Agent following j5-live-test. Report: test-reports/j5code-outside-agents-498.md. The head has moved since.

Re-test: pass, at the final head acc6911d06, by a second Peer Agent. Report: test-reports/j5code-outside-agents-498-retest.md. Since 25b8bee1a3 the branch was rebased over #557 and #563, the person's row in a listing changed beneath it, and the envelope and first-turn wording changed. Ran live on that head: an outside agent's listing carries the listed project's id and title on the person's row; a plain send lands with the new envelope and the card hides it; a refused ask; a spawn with the new first-turn line; and on two peered servers, an in-app steer into a busy remote agent, a refused steer with its notice, and an outside agent's send to a remote agent refused. Not repeated on this head: the rest of the first pass (Claude turns, restarts, migration, read-only sign-in, revoke).

Ran live: a real OAuth sign-in as an outside agent; listing, sending, spawning, retrying and stopping; every refusal, with its text; one receiving turn each on Codex (Luna) and Claude (Haiku); one turn sent through the UI; a restart at rest and a restart during a held turn; migration 33 on a copy and on a fresh home; a refused send to an agent on a peer server; a read-only sign-in; revoking the sign-in; an in-app agent asked in plain words to answer an outside agent's message and to message another agent; the browser pass after the rebase.

Not exercised live:

  • The desktop shell, mobile, relay and tunnel connections, and providers other than Codex and Claude. The rig cannot reach them.
  • A persona above the approved level being refused, and j5_archive_crew, j5_clear_own_ask and the playbook tools other than start and current. Unit tests cover these.
  • Releasing a queue held by a restart. A queued outside message stayed held after a restart during a held turn, which is existing restart behaviour.
  • Starting a Haiku agent with j5_spawn_agent. The tool refused the test home's Haiku model because it exposes no reasoning options, so the spawn was verified on Luna.

Nothing needs a person to test by hand.

Observed and not caused by this PR: a Haiku thread switched from Full access to Auto failed its next turn with "auto mode unavailable for this model"; and an in-app agent listing another, empty project sees the person's row labelled with the agent's own project.

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
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR (none edited)
  • 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 (D2 rewritten)
  • Live testing: the section above says what ran live and what did not
  • 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: web changed; desktop wraps web; mobile has no matching surface. Not provider-shaped. An outside agent reaches this server only, in every connection mode. Reverse state: revoking the session in Settings → Connections retires the identity.

Built by Claude Opus 5.5 in Claude Code, with subagents for the three slices.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 12, 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 12, 2026 9:28pm UTC

Request Review

@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from 0a9dd9d to b971c45 Compare October 12, 2026 05:40
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from dada229 to c7f1531 Compare October 12, 2026 06:20
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from c7f1531 to 25b8bee Compare October 12, 2026 06:49
Jacksondr5 added a commit that referenced this pull request Oct 12, 2026
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from 25b8bee to 9ad520d Compare October 12, 2026 07:16
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from 9ad520d to 69791c2 Compare October 12, 2026 07:30
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from 69791c2 to 83c224a Compare October 12, 2026 07:36
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from 83c224a to 3bdad7d Compare October 12, 2026 19:26
@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Oct 12, 2026
An agent signed in from outside the app (an MCP OAuth client) could read the
fleet but could not message, start or stop an agent, because J5's tools all
acted as a calling thread and upstream's own send and launch tools are hidden.

An outside agent now has a ledger identity, one per sign-in:
`outside:<session id>`, shown by the label the client registered.

- j5_send_message: a plain message to an agent on this server, recorded in the
  receiver's project. Nothing can be delivered to an outside agent, so asks,
  replies and messages addressed to one are refused.
- j5_spawn_agent: starts an agent in a project the caller names, at the top
  level, with the outside agent recorded as its spawner.
- j5_list_participants and j5_stop_agent accept an outside agent.
- The approved sign-in level caps every send, stop and spawn, a persona
  included. A read-only client changes nothing.
- Tools that need a calling thread refuse an outside agent through one helper
  that names what to do instead.
- Web names the outside agent on the thread card, the "Spawned by" line and
  the Fleet row.

Ledger migration 33 adds `j5_a2a_outside_agent`, which keeps each label.

Closes #498.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Jacksondr5
Jacksondr5 force-pushed the j5code/outside-agents-498 branch from 6bd4cb3 to acc6911 Compare October 12, 2026 21:27
@Jacksondr5
Jacksondr5 changed the base branch from j5code/spawn-519 to j5code/remote-steer-519 October 12, 2026 21:27
@Jacksondr5
Jacksondr5 added this pull request to stack #567 October 12, 2026 21:27
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 47 billable files and costs up to $11.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 56 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 55 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 43701214-1250-471f-9136-f400a369fec3

📥 Commits

Reviewing files that changed from the base of the PR and between 878b317 and acc6911.


📒 Files selected for processing (47)
  • apps/server/src/j5/a2a/ClientReadsService.test.ts
  • apps/server/src/j5/a2a/ClientReadsService.ts
  • apps/server/src/j5/a2a/DeliveryTransport.integration.test.ts
  • apps/server/src/j5/a2a/DeliveryTransport.ts
  • apps/server/src/j5/a2a/DeliveryWorker.test.ts
  • apps/server/src/j5/a2a/DeliveryWorker.ts
  • apps/server/src/j5/a2a/EnvelopeFormatter.test.ts
  • apps/server/src/j5/a2a/EnvelopeFormatter.ts
  • apps/server/src/j5/a2a/FleetReadsHttp.test.ts
  • apps/server/src/j5/a2a/FleetReadsHttp.ts
  • apps/server/src/j5/a2a/Migrations.test.ts
  • apps/server/src/j5/a2a/Migrations.ts
  • apps/server/src/j5/a2a/PeerInboundService.ts
  • apps/server/src/j5/a2a/PlacementService.ts
  • apps/server/src/j5/a2a/README.md
  • apps/server/src/j5/a2a/SendService.outsideAgent.test.ts
  • apps/server/src/j5/a2a/SendService.ts
  • apps/server/src/j5/a2a/SpawnCompositionService.test.ts
  • apps/server/src/j5/a2a/SpawnCompositionService.ts
  • apps/server/src/j5/a2a/contracts.ts
  • apps/server/src/j5/a2a/envelopes.v1.json
  • apps/server/src/j5/a2a/mcp/handlers.test.ts
  • apps/server/src/j5/a2a/mcp/handlers.ts
  • apps/server/src/j5/a2a/mcp/orchestratorSurfaceHandlers.ts
  • apps/server/src/j5/a2a/mcp/outsideAgent.test.ts
  • apps/server/src/j5/a2a/mcp/outsideAgent.ts
  • apps/server/src/j5/a2a/mcp/tools.ts
  • apps/server/src/j5/a2a/migrations/033_OutsideAgents.test.ts
  • apps/server/src/j5/a2a/migrations/033_OutsideAgents.ts
  • apps/server/src/j5/a2a/outsideAgentNames.ts
  • apps/server/src/j5/a2a/spawnIds.ts
  • apps/server/src/j5/a2a/spawnWorkspace.test.ts
  • apps/server/src/j5/playbooks/mcp.test.ts
  • apps/server/src/j5/playbooks/mcp.ts
  • apps/web/src/j5/a2a/SpawnBrief.test.tsx
  • apps/web/src/j5/a2a/SpawnBrief.tsx
  • apps/web/src/j5/a2a/ThreadA2ARenderer.test.tsx
  • apps/web/src/j5/a2a/ThreadA2ARenderer.tsx
  • apps/web/src/j5/fleet/FleetPage.tsx
  • apps/web/src/j5/fleet/fleet.logic.test.ts
  • apps/web/src/j5/fleet/fleet.logic.ts
  • docs/j5/product/a2a/agent-tools.md
  • docs/j5/product/a2a/index.md
  • docs/j5/product/features/fleet-page.md
  • docs/j5/product/glossary.md
  • docs/j5/product/upstream.md
  • packages/contracts/src/j5.ts

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Jacksondr5 added a commit that referenced this pull request Oct 12, 2026
@Jacksondr5
Jacksondr5 merged commit b20c0d5 into j5/main Oct 12, 2026
36 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/outside-agents-498 branch October 12, 2026 21:45
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026

This branch was successfully deployed

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

Labels

size:XXL 1,000+ 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.

Outside agents (MCP OAuth clients) need a ledger identity to message and start threads

1 participant