Repository navigation
fix(computer): Windows computers record to a local store, run sandboxed apps, and export held files - #549
Merged
Conversation
…s a container does A Windows computer's recording never reached a local object store: its guest couldn't resolve host.docker.internal, the host local grants name, nor trust the local transfer CA. As lume's VMs do, the guest now maps that name to 10.0.2.2, QEMU's address for the launcher, which forwards the grant server's port to this machine (VM_HOST_PORTS), and the CA's trust files ride in the seed (VM_TRUST), where Linux's init and Windows' agentenv-session point TLS clients at them. The local provider passes both when the store hands out grants; lume's helper for them is now shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ards its own grant port Each process that hands a computer grants serves them on a port of its own, so a reconnect forwards this process's into the launcher, as lume's VMs get theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r own program C:\agentenv granted only Administrators, SYSTEM and Users, so Chrome's sandbox, whose processes run as the app package identities, couldn't read chrome.exe there: its network service crashed and no page loaded. The lockdown now grants ALL APPLICATION PACKAGES and ALL RESTRICTED APPLICATION PACKAGES read and run, as Program Files does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…copies it, and relaunches it Windows lets an app hold a file so that no other process may read it, as Chrome and Electron hold their profiles, and a pause doesn't release it, so data/get, snapshots and gate 3's probe failed with WinError 32 on such an app. Where the paused copy hits a sharing or lock violation, the data plane stops the app, copies, and relaunches it, with data/get as the launch's cause; an app holding nothing keeps the pause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…raises, as both sessions do Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nned to a container's, and named checks The launcher's forward is one function, behind launch forward PORT, which a reconnect runs rather than spelling socat out again, guarded for a launcher older than it; a test pins both guests' trust variables to trust_env's; the provider names its disk check, logs a forward it couldn't make and finds the granting store in one place; the data plane's held-file retry is a helper of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s left of data_timeout_s The retry after a held file had a second full window, so a large export that met a held file late could take nearly twice the app's data_timeout_s. Both attempts now share one deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g a grant port into it terminate_sandbox reconnected through get_sandbox, which now forwards this process's grant port into a disk's launcher, so every local disk run ended by forwarding into a computer it was removing, and warned when the launcher was already gone. The local provider terminates by id without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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-5315.
The bench's Windows trials hit three gaps in how a Windows computer runs on local Docker. This PR fixes all three; each is a separate commit.
transfer_unavailable. The guest couldn't resolvehost.docker.internal, the host local grants name (confirmed inside a Windows guest:getaddrinfo failed), and wasn't given the local transfer CA to trust. Linux disk VMs on local Docker had the same gap.C:\agentenv, failed withSandbox cannot access executable ... Access is denied; then its network service crashed and no page loaded.data/getfailed on an app that holds its files. Chrome and every Electron app hold profile files so that no other process may read them, and pausing the app doesn't release them. Sodata/get, the snapshots built on it, and gate 3's probe failed withWinError 32. On the bench's G04, 47 of the workspace's 281 files were held.What changes
1. Local grants reach a disk's computer, as lume's VMs already do
The grant URL stays
https://host.docker.internal:<port>/...; the guest is what learns to reach it.host.docker.internalto 10.0.2.2, the address QEMU's user network always gives the launcher. Windows' base setup writes it to the hosts file once; Linux's boot init writes it into/etc/hosts.VM_HOST_PORTS: for each port, socat on the container's loopback forwards tohost.docker.internalon the Docker host, where the grant server listens. A host port that collides with a guest port's proxy or forward is refused with the reason.VM_TRUST, a folder of trust files it copies into the seed astrust/. Windows'agentenv-sessionand Linux's init pointSSL_CERT_FILE,REQUESTS_CA_BUNDLEandNODE_EXTRA_CA_CERTSat them, as containers get. The seed's own variables still win.--add-host host.docker.internal:host-gatewayon Linux. lume's private helper for the port and trust files is now shared.get_sandbox), the provider forwards that process's port into the launcher too, as lume does. A reset reconnects before it hands the computer anything. A teardown terminates the computer by id, with no forward.2. Sandboxed apps read and run their own program under
C:\agentenv#540's lockdown granted only Administrators, SYSTEM and Users. A sandboxed process, such as Chrome's renderers and network service, runs as the app package identities, which Program Files grants read and run. The lockdown now grants ALL APPLICATION PACKAGES (
S-1-15-2-1) and ALL RESTRICTED APPLICATION PACKAGES (S-1-15-2-2) read and run too, the access Users already have. Nothing becomes writable, and each app's.agentenvfolder keeps its own private access list.3.
data/getof a held file stops the app, copies, and relaunches itThe default
data/getstill copies the app's paths with the app paused. Only when that copy hits a file the app holds (Windows' sharing or lock violation, errors 32 and 33),getraisesHeldByApp. For that error alone, the data plane stops the app, copies again in what's left of the call'sdata_timeout_s, and relaunches it, withdata/getas the launch's cause. Apps that hold nothing keep the pause, and POSIX never raises those errors. An app whose owndata/gethook callsgetgets the same.Costs and follow-ups
agent-env task run --start-stepthat records on a kept local disk computer without reconnecting would hand the guest an unreachable grant. lume's VMs have the same gap.data/geton Windows without restarting the app, for example through Volume Shadow Copy, which needs a privileged helper.Tests
test_disk_recipe.pyand the sandbox providers' tests:test_computer_windows.py: the session points TLS clients at a seed's trust folder and at nothing without one; the lockdown line grants the app package identities.launch forwardserves a host port as the boot does, and both guests' trust variables matchtrust_env()'s (1792 passed across these files at the final commit).chrome.exe, then the probe'sdata/gethit Chrome's and Electron's held files. With it, the desk composed and passed gate 3's probe, whosedata/getcopied with the apps stopped and relaunched them. The trial ran and was graded, with its end snapshot taken the same way (32 s), GUI-only clean and 12 of 12 segments uploaded.form = "disk"(the desktop's disk composed, then booted under KVM), passed; its recording ended with its segment uploaded, 0 missing.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the latest change skips an unnecessary grant forward without changing cleanup.Summary
This PR lets disk computers reach local upload grants, gives sandboxed Windows apps read-and-run access to their programs, and retries held-file exports with the app stopped.
C:\agentenv.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Reconnect[Reconnect by id] --> Found[Restore saved sandbox handle] Found --> Forward[Forward this process's grant port for disks] Forward --> Use[Return sandbox] Teardown[Terminate by id] --> Restore[Restore saved sandbox handle] Restore --> Stop[Run existing sandbox cleanup]Reviews (11) · Last reviewed commit: "fix(local): a teardown terminates a disk..." · Reviewed by Greptile