Skip to content

put the sandbox backends in a package of their own, with the protocol to run one as a service - #187

Merged
hkonsti merged 3 commits into
mainfrom
hkonsti/sandbox-backends
Nov 5, 2026
Merged

hkonsti merged 3 commits into
mainfrom
hkonsti/sandbox-backends

Conversation

@hkonsti

@hkonsti hkonsti commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@proxy/backends takes over what backends/sandbox held in the api (#185), so that the internal repo can import it through its submodule and run hosted Personal Agent Proxy's sandbox service on the same contract and tests:

  • backend.ts, conformance.ts and temp-dir.ts as before, the temp-dir backend now taking its root directory.
  • @proxy/contracts/sandbox: the protocol, one route per method of the contract, a bearer token, errors as the api's kinds with their statuses.
  • remote.ts: a backend reached over that protocol. What the service says went wrong comes back as the api's kind; a service out of reach is a provider out of reach.
  • serve.ts: any backend behind the protocol, as a request handler for Bun.serve. The conformance tests run the temp-dir backend through server and client as well.

The api reads SANDBOX_BACKEND as off, remote (with SANDBOX_SERVICE_URL and SANDBOX_SERVICE_TOKEN) or dev (the temp-dir backend, which only a development server takes, since it runs commands on the machine with no isolation). Nothing consumes the chosen backend yet; the Sandboxes integration is next. The image, the Blueprint's build filter and compose carry the new package and variables.

bun install also brought the lockfile's entry for the desktop package up to its package.json, which #176 changed without it; the frozen install evidently doesn't flag workspace manifests.

… to run one as a service

@proxy/backends holds what backends/sandbox held in the api, so that the internal repo can import
it through its submodule: the contract, the conformance tests, the temp-dir backend, now with its
root given, a client for a backend run as a service elsewhere (remote.ts) and what puts any
backend behind that protocol (serve.ts). The protocol is in @proxy/contracts/sandbox: one route
per method, a bearer token, errors as the api's kinds. The conformance tests run the temp-dir
backend through server and client too.

The api picks its backend from SANDBOX_BACKEND: off, remote with the service's address and
token, or dev, the temp-dir backend, which only a development server takes.

bun install also brought the lockfile's entry for the desktop package up to its package.json,
which #176 changed without it.
@hkonsti
hkonsti force-pushed the hkonsti/sandbox-backends branch from f9bf743 to a03c77d Compare November 4, 2026 23:12
…nly what every backend does

agentOS ends a command's background processes with the command, so the conformance test that
left one running across a sleep asked for more than the contract promises; the contract says so
now, and the test is gone.
…mised

agentOS answers an aborted command with none of its output, so the conformance test no longer
asks for what a stopped command wrote; the contract says it is kept where the backend can.
@hkonsti
hkonsti merged commit 2068c2d into main Nov 5, 2026
3 checks passed
@hkonsti
hkonsti deleted the hkonsti/sandbox-backends branch November 5, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant