Repository navigation
feat(gateway): a computer's browser requests take the role of whoever drives it, and its calls claim no one's writes - #725
Merged
earakely-scale merged 3 commits intoNov 17, 2026
Conversation
… drives it, and its calls claim no one's writes The gateway keeps each computer's driver, the role of the last input call to its tools (set as the call starts, on every child-call path, a trigger action's under its `as`). The computer's site proxy names its computer (AgentEnv-Computer) and drops a page's AgentEnv-Role, and a request naming a computer takes its driver's role. A computer's tool calls log no write window, so changes/v1 names the browser's request or the party that wrote. Part of FD-5968. Part of FD-5944. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry computer call's window, a trigger's too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tools and input tools apart A computer was a child the gateway passes its control token on to, which the provider names only when the gateway has a token. The provider now names the gateway's computers (COMPUTERS) whether it has one or not, and the gateway keeps each computer tool's computer and the set of input tools rather than a tuple of both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/browser-requests-take-the-drivers-role
branch
November 17, 2026 03:18
This was referenced Nov 17, 2026
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.
Part of FD-5968. Part of FD-5944.
Why
On a multi env with a computer, the agent writes to the sites through its browser. Those requests go from the computer's site proxy to the gateway with no
AgentEnv-Role, so the gateway read them asdefault. In HB1.12's weekend-away run 2, all 8 website trigger detections came from the agent's Chromium asdefault. That meant three things:default, and then any other browser set it off too;changes/v1recorded the agent's browser writes as others' (19 in run 2).changes/v1also gave a computer call a write window for as long as it ran. Adesktop_computer_waitcan run for seconds, and every write another party made meanwhile was counted as the agent's (20 in run 2).Several agents may share one computer with different roles, so the role can't be fixed per computer. It follows whoever is driving. Design: Triggers on Computers, gap 1, decision 1 (option C), and gap 2.
What changes
The gateway keeps each computer's driver. The provider tells the gateway its computers, a multi env's children on sandboxes of their own (
COMPUTERS, with or without a control token). A computer's driver is the role of the last input call to its tools, one withoutreadOnlyHint. It's set as the call starts, in_call_child_tool, the path every child call takes:/mcp,/step, and a trigger action under itsasrole. Setting it at the start means a request the page sends before the call returns is credited to the caller. A screenshot or a wait changes nothing.A request names its computer. The computer's site proxy sends
AgentEnv-Computer: <its name in the multi env>from its private upstream headers (sites.route'slabel, the name the gateway knows the child by). It drops anyAgentEnv-ComputerorAgentEnv-Rolea page sends.The gateway gives the request its driver's role (
_request_role):AgentEnv-Rolestill wins;default, as before anyone has driven, or for a computer the gateway doesn't front, such as one deployed alone.Website triggers, state re-checks, the forwarded role and
changes/v1all read this role.A computer's calls claim no writes.
changes/v1(ChangeAttribution) counts no write window for a call to a computer's tools, through/mcp,/stepor a trigger action. A computer writes the env's data only through its browser's requests, which carry their own windows. So a write the browser made goes to the request's role, and one another party made during the call goes to that party. The trajectory still records every call's changelog ids.A request's role is read once and kept on the request, so its forwarding, its write and its triggers name one role even if someone else drives before it ends.
Docs:
AGENTS.md's gateway entry describes the rule.always_onneeds no change: itsapp_changescount a write as the agent's when a request or call of the agent's role made it, which is now right on a computer.Tests
tst/unit/env/gateway/computer_driver_test.py), on an in-process gateway with a site and a computer:default;AgentEnv-Rolestill wins;as: noramakesnorathe driver.AgentEnv-RoleandAgentEnv-Computer, and its header names equal the gateway's.sites.routeputs the computer's name in each site's upstream headers.computer_triggers_test.py): on a real computer with site routing,personand thenhelpereach move the pointer and loadhttps://shop.test/api/healthfrom inside the computer. The site's website trigger seesperson, thenhelper. Both tests in the file passed on a Linux host with Docker, the gateway image built from this branch, in 4 min 26 s.tst/unit/envandtst/unit/task_steppass locally, excepttest_disk_recipe.py's Windows install test, which fails the same way onmainon macOS because its temporary path is too long for a Unix socket.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues remain.Summary
Browser requests take the role driving their computer, while computer tool calls claim no writes.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A["Input tool call"] --> B["Save caller as computer driver"] B --> C["Browser request names computer"] C --> D["Read and keep request role"] D --> E["Forward request"] D --> F["Attribute writes and check triggers"] A --> G["No tool write window"]Reviews (8) · Last reviewed commit: "refactor(gateway): the gateway is told i..." · Reviewed by Greptile