Repository navigation
feat(bridge): an agent's calls to another computer are marked, and that computer treats them more strictly than a person's - #1235
Merged
Conversation
12 tasks done
bvsr365
force-pushed
the
agent-calls-marked-across-computers
branch
from
November 15, 2026 15:41
848a085 to
01e059f
Compare
… computer's daemon sets
The key agent { thread, run, title, hops, mode } is new on threads.create, threads.setModel,
threads.setPermissionMode, orchestrator.send, orchestrator.steer, queue.enqueue and
orchestrator.abort, each at a new version. It is not droppable, so a caller refuses to send it to
an owner that predates it. A window that names it is refused by the router.
Refs #1160
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt's, never as a person's A marked call runs through a remote agent actor carried in AgentActor.remote: source mcp, the narrowest of the carried mode and the device limit (and the thread's own), an envelope the owner builds with the sender's cleaned title and the computer's name from its own pairing record, refused while a question or approval waits, a steer into a looser run refused, sentFrom on the thread, run and queued item, and an audit row with actor agent. The owner keeps its own limits: hop count, a per-thread rate limit, a refused identical repeat and a daily run budget per device. Agent reach per device (net_node_policy.agent_reach, default launched) decides which threads a device's agents may change. A thread such an agent starts records startedFrom.agent and is held to the narrowed mode from its first write; origin.from replaces origin.threadId for such a sender. Refs #1160 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uter knows the mark, and keeps its first form A remote subagent's create, model, mode, send and Stop calls carry the agent mark when every row that has it is at the version that added it on the far computer. A computer from before the mark gets them unmarked, as before. The form is decided by the subagent's first call and kept on its rows (remote_subagents.marked, migration 18), since the far computer's replay ledger is keyed by method and a switch could send a task twice. Refs #1160 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e and agent reach storage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gent's may do, and that it is a policy, not a boundary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… recorded as an uncertain outcome Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…database contract 18 The two-daemon remote subagent test now expects the owner to take the task as an agent's (source mcp, startedFrom.agent). The settings revision test reads the version that added ifRevision rather than assuming it is the row's newest. The run database contract moves to 18 for remote_subagents.marked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; run database contract 19
The owner's envelope for an agent on another computer is agentMessage with { computer }, so the
bubble shows only the agent's words for such a message too. Migration 19 (remote_subagents.marked)
follows #1220's 18. The Full access remote subagent test's stand-in returns the run's sequence, as a
real send does, and checks the marked thread is held to Full access, not capped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvsr365
force-pushed
the
agent-calls-marked-across-computers
branch
from
November 15, 2026 15:49
88d224d to
531adb2
Compare
…nd repeat check every agent has #1222's caps (three waiting per sender, ten in all) and its repeat check (duplicate_message) count a sender on another computer by its computer and thread (origin.from), so one computer and two follow one rule and one set of codes. The owner path's own repeat check is gone; its rate limit and daily budget stay. Refs #1160 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 15, 2026
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The only way an agent reaches another computer today is a remote subagent, and the other computer (the owner) records every call it makes as a person's: source
gui, "Always" rules apply, a/skillin the text runs, and the mode goes up to the device limit. The agent threads design (#1161, §4.3) needs those calls marked as an agent's, so the owner can hold them to an agent's rules. Three later PRs (thread_createwithcomputer, thread tools on qualified ids,runs.wait) build on this one.Change
The key.
agent: { thread, run, title, hops, mode }on seven routed rows:threads.create,threads.setModel,threads.setPermissionMode,orchestrator.send,orchestrator.steer,queue.enqueueandorchestrator.abort, each at a new version. It is not droppable, so a caller never sends it to an owner that predates it (computer_outdated). Field names avoid…Id, so the id rewriting leaves them alone. Any change to the key's shape or meaning bumps all seven rows (written besideROUTED_AGENT_KEY).Who may set it. Only the daemon's own service.
ThreadRouterrefuses it from a window. A phone'sthreads.createtakes exact keys, and the backend refuses the key outright.The owner handles a marked call as an agent's (
remoteAgent.ts). The calling computer comes from the authenticated link, its name from the owner's pairing record. The call runs through the pathsthread_sendandthread_steeruse, with a remote actor (AgentActor.remote) that carries the sender's mode and hops, so nothing is looked up from a local run (which would fall back to the profile default). A marked call:mcp(no "Always" rules, noperson_turn);/skillor workflow commands;questions_pending);ceiling_exceeded);agentMessagewith{ computer }): the title cut to 80 characters, control, direction and zero-width characters removed, the computer's name in place of a thread id, both markers defused in title and body, the body capped at 16,000 characters, andorigin.bodyset so the Agent bubble shows only the agent's words;sentFromon the thread, the run (run.sent_from) and a queued item, so blocking the device removes the agent's work;agent(newbridge_audit.actorcolumn).Stored sender.
origin.from { node, thread, run, title }withorigin.threadIdunset. A rule inroutedIds.tsbesidequalifyStartedFromleavesfromunchanged on every computer. The durable queue keepsfromandbodyacross a restart. The Agent bubble's header shows such a sender's title without a link, since its thread is on the other computer.Threads such an agent starts record
startedFrom.agent { thread, title, mode }and are held to the narrowed mode from the same write that records them.createdByThreadIdstays unset. A markedthreads.setPermissionModeabove that mode is refused (agent_mode_above_thread). Such a thread cannot start subagents on a third computer (the existingremote_from_remoterule, now tested through a marked create).Limits. A marked message has the same queue caps and repeat check as any agent's message (feat(threads): thread_read is bounded and reads on; agent messages are capped per sender #1222): three waiting per sender and ten in all (
agent_queue_full_per_sender,agent_queue_full), and the same text from the same sender within two minutes refused (duplicate_message). A sender on another computer counts as its computer and thread (origin.from), so one computer and two follow one rule and one set of codes; there is no second cap or repeat check. The owner adds limits of its own, each with its own code:agent_hops_exceeded);agent_rate_limited);agent_daily_budget).The rate limit and the budget are counted from the audit, so a restart does not reset them. A follow-up from the agent that started the thread adds none of the owner's own count, as a follow-up to a subagent does on one computer.
Agent reach (
net_node_policy.agent_reach:none,launchedby default, orall) decides which threads a device's agents may change, from the owner's ownstartedFromat each call. A marked Stop ends only runs an agent of that device started, and leaves a thread a person took over. Storage and enforcement only; no setting in the app.Remote subagents send the key when every marked row on the far computer is at the version that added it, and stay unmarked on an older computer. A subagent keeps the form of its first call for good (
remote_subagents.marked, run database migration 19, after feat(subagents): a subagent on another computer runs within the limit that computer set, with no fixed Auto-accept edits cap #1220's 18), because the owner's replay ledger is keyed by method.Docs.
threat-model.md("Calls marked as an agent's") and SPEC §15.1 state the rules. They also say that the mark is a policy for honest callers, not a boundary.How to review
Read the commits in order:
feat(bridge): seven routed calls take an agent mark…: the table (routed.ts), the version record and the window refusal. Low risk.feat(bridge): the owner handles a call marked as an agent's…: the core.remoteAgent.tsdecides everything about a marked call.OwnerRoutes.runstrips the mark and hands the call over.OrchestratorServicegets three small entry points (sendForRemoteAgent,steerForRemoteAgent,stopForRemoteAgent);senderMode,agentEnvelopeandagentOriginOfhonouractor.remote.The risk is in what
thread_send's path does with a sender that has no local run. CheckwithAgentHops,senderMode, and thatbotSenderOfis skipped for a remote actor.style(net): formatting only.feat(subagents): the calling side and its migration.Tests, then docs.
Verification
Tier 5 (daemon protocol, permissions, security). Tested commit:
fa352d287b7e8898b8ddf1240a03ef5fbbafcbf4, rebased onorigin/master73cf19a (after #1220, #1222, #1223, #1224, #1161). The 30 named test files below pass on it (549 tests), andtsc --noEmitis clean fortsconfig.node.jsonandtsconfig.web.json. Master has since gained #1246 (registerGuiIpc.tsand a GUI test only), which merges without conflict.npx vitest run tests/net/bridge/routed/agentMark.test.tsruns two real daemons over Bridge, with only the turn stood in for. It checks:startedFrom.agent, nocreatedByThreadId, and no remote subagent from that thread;mcp,origin.fromwithoutthreadId, the owner-built envelope with a defused marker and an unread/review, the mode narrowed to the carried mode and the device limit,run.sent_from, threadsentFrom, an audit row with actoragent, and a replay with the same request id giving one run;sentFrom, the origin after a restart's read ofqueue.json, a person's edit taking it over, and the drain running it as the agent's;launched,none), a malformed mark, a window and a phone refused;questions_pendingfor a send and a steer,ceiling_exceeded,agent_mode_above_thread,agent_message_too_longandduplicate_message(another sender on the same computer may say the same);agent_queue_full_per_sender, while another thread on that computer is another sender;tests/run/remoteSubagents.test.ts: every changing call is marked where the far computer knows the mark; an older computer's subagent stays unmarked for good, even after that computer is updated; the existing scenarios pass unchanged against an older computer.tests/net/bridge/routed/remoteSubagents.test.ts(two daemons): a subagent between two current computers is marked (sourcemcp,startedFrom.agent), and Full access crosses once the owner allows it (feat(subagents): a subagent on another computer runs within the limit that computer set, with no fixed Auto-accept edits cap #1220's rule, no fixed cap).tests/net/bridge/routed/remoteAgentEnvelope.test.ts(title cleaning, the envelope and itsbodylengths, the mark parser as tables),ids.test.ts(origin.fromandstartedFrom.agentleft as written),table.test.ts(exactly seven marked rows, each new at the row's version, never droppable;routedVersions.jsonregenerated, no security column changed),tests/net/store/nodePolicyMigration.test.ts(theagent_reachcolumn on an old database, restart, unknown values).agentMessageBubble,queuedMessagesInChat,threadTitleText,threadMessageQueue,mcpToolRegistry,delegationGuidanceand the thread-tool daemon tests (feat(threads): thread_read is bounded and reads on; agent messages are capped per sender #1222's limits, feat(chat): a message an agent sent shows as a labelled "Agent" bubble with only its words #1223's envelope and bubble).npm run test:unit(on the earlier base 46d0114, not repeated after this rebase): 1454 files passed, 18 failed.routed/remoteSubagents,threadSettingsRevision, andcontractVersions(the run database contract is now 19).origin/masterhere:botWatchers,cliLaunch,platformProductionComposition,profiler.npx tsc --noEmit -p tsconfig.node.json: clean.remoteSubagents.test.tsand byRoutedClient's existing refusal of unknown keys); theprocesslane; a real provider turn (turns are stood in for).Notes
readaccess ceiling is written for a thread an agent on another computer started. Agents can read and manage any thread; the agent access setting is gone #1197 removed agent access levels on purpose and ignoresThread.accessCeiling.remote_subagents.marked).routedVersions.json. Marked calls stay out ofCROSS_USER_METHODS; whichever lands second regenerates the record.Refs #1160
🤖 Generated with Claude Code