Skip to content

local-sandbox: allow reaching the exec daemon over a peer network - #243

Open
LeoneNee wants to merge 1 commit into
yc-software:mainfrom
LeoneNee:sandbox-peer-network
Open

local-sandbox: allow reaching the exec daemon over a peer network#243
LeoneNee wants to merge 1 commit into
yc-software:mainfrom
LeoneNee:sandbox-peer-network

Conversation

@LeoneNee

@LeoneNee LeoneNee commented Aug 6, 2026

Copy link
Copy Markdown

Problem

local-sandbox reaches the sandbox exec daemon at a hard-coded http://127.0.0.1:<port>. That only works when core runs on the docker host itself. When core runs inside a container — the shape deploy/core/Dockerfile produces — loopback inside the core container is the container itself, not the host publishing the sandbox's mapped agent port. Every exec/read/write against the sandbox fails with fetch failed, and the agent reports its computer backend down.

Change

With LOCAL_SANDBOX_PEER_NETWORK set:

  • sandbox containers are attached to that docker network after docker run / docker start (docker network connect, idempotent)
  • core reaches the daemon by container name on AGENT_PORT instead of via the published loopback port

Unset keeps the loopback behavior used when core runs on the host, so existing single-process setups are unaffected.

The exec daemon is unauthenticated (loopback binding is its access control), so this option is only for a trusted internal network — e.g. the private stack network shared with the core container, never a public one.

Tests

test/local-sandbox.test.ts passes (15/15). The option was also exercised end to end with core in a container: a turn executed in the sandbox container and a file written through the exec daemon was verified from the host volume.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The exec daemon URL is hard-coded to 127.0.0.1, which only works when
core runs on the docker host itself. When core runs in a container
(the shape deploy/core/Dockerfile produces), loopback is the core
container, not the host publishing the sandbox port, so every exec,
read, and write fails with fetch failed.

With LOCAL_SANDBOX_PEER_NETWORK set, sandbox containers are connected
to that docker network after run/start and core reaches the daemon by
container name on AGENT_PORT. Unset keeps the loopback behavior used
when core runs on the host. The daemon is unauthenticated, so this is
only for a trusted internal network.
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