Skip to content

Choose the sandbox backend at install time so Add node is ready after install - #152

Merged
SaladDay merged 3 commits into
mainfrom
codex/install-sandbox
Sep 26, 2026
Merged

SaladDay merged 3 commits into
mainfrom
codex/install-sandbox

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Phase 2b-installer of the new-user install work: the Core installer picks the sandbox backend at install time, so Add node is available straight after install. The installer no longer adds its own host as a node.

  • install.sh --sandbox docker|microsandbox|e2b|none
    • The default is docker. --web-only allows only none.
    • After the services are healthy, the installer creates the deployment once through POST /core/v1/sandbox/deployment with the Core key. It sends the same body Web's setup sends.
    • Docker and microsandbox use the bundled copy of apps/web/src/features/sandbox/standard-sizes.json, the single source for the Standard size, plus the bundle manifest's Runtime release.
    • E2B takes --e2b-api-key-file and --e2b-template. The key file must be an absolute path, private, not a symlink and at most 4 KiB; it is read with O_NOFOLLOW and fstat. E2B is refused before anything is created when the public URL is loopback or missing.
    • The key is sent only in the request body and is redacted from Core's error text.
    • The choice is a one-time action: it is not stored as a setting, and repair or --convert never create a deployment.
    • If Core refuses, the services keep running, the installer prints Core's message and exits non-zero. The same happens after a failed first start: the message then says the backend was not chosen and names where to choose it.
  • Retired:
    • --sandbox-provider and --provider fail with a message that names --sandbox.
    • local_node.py becomes sandbox_setup.py. The installer's own node enrollment and its use of PARSAR_NODE_ENROLLMENT_TOKEN are removed.
    • Hosts, including the Core host, are added with Add node in Web.
  • Build: build-core-distribution.sh copies the sizes file into the bundle, and bundle verification requires it.
  • Docs: README, the getting-started guides, configuration.md (the sizes table now points to the file), the Hosted Sandbox Manager guide, CONTRIBUTING and the microsandbox README.

Review

  • Independent blind review: no P0 or P1. It verified that the POST bodies match Web's and Core's input, that the E2B key never leaks, that refusals leave nothing behind, and that parsar works without local_node.py.
  • The P2 (an explicit --sandbox choice lost after a failed first start) and the P3s were fixed in 92cd1480: stale docs, tests for key-file refusals and a missing sizes file, O_NOFOLLOW reads, and exact size keys. They were verified by tests and the gate, per the small-fix rule.

Verification

  • Full local server gate on 92cd1480, the exact head including main 1f0920aa, passed. The Playwright browser cases were skipped on the server (Chrome unavailable; approved skip).
  • Real check on an isolated mx1 install at ac05d3aa (Kimi only):
    • The default install created a Docker deployment matching the bundled sizes and manifest. Web saw a configured provider with zero nodes, so the Nodes page offers Add node.
    • --sandbox none created no deployment.
    • Loopback E2B, the retired flags and a web-only backend were refused with nothing created.
    • A node added with Web's current command came online, and a real Kimi Turn ran on it.
  • E2B and microsandbox selection are unit-tested only. Real checks of both are scheduled for the final acceptance.

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

…the install host

install.sh --sandbox docker|microsandbox|e2b|none (default docker, none for
--web-only) saves the deployment through /core/v1/sandbox/deployment once the
services are healthy, as Web's setup would. Docker and microsandbox use Web's
Standard size from the bundled copy of apps/web/src/features/sandbox/standard-sizes.json
and the bundle's Runtime release; E2B takes --e2b-api-key-file and --e2b-template
and is refused before anything is installed when public_url is loopback. A repair
or conversion never selects a backend. A refused selection prints Core's message
and exits 1 with the services running.

The installer no longer adds its own host as a node: local_node.py becomes
sandbox_setup.py without the enrollment code or PARSAR_NODE_ENROLLMENT_TOKEN, and
--sandbox-provider and --provider fail naming --sandbox. The summary says what the
sandboxes are and where to add nodes, or why a loopback install can't yet.
… key file read

A new installation whose first start fails now ends its error with "The sandbox
backend was not chosen; after the repair, choose it ...", because the repair run
never selects a backend.

Private key files (the E2B API key and the Core key) are opened with O_NOFOLLOW
and O_NONBLOCK, checked with fstat and read up to the 4 KiB limit plus one byte.
The bundled standard-sizes.json must have exactly each provider's fields.

Docs: CONTRIBUTING and the microsandbox guide no longer mention local-node flags;
the install guide states the E2B key file rules. Tests cover a symlinked or 5000-byte
E2B key file and a checksum list without standard-sizes.json.
@SaladDay
SaladDay merged commit 2b5c99a into main Sep 26, 2026
3 checks passed
SaladDay added a commit that referenced this pull request Sep 26, 2026
Web's Add node command passes the token on standard input in both modes (#148),
and the Core installer no longer sets the variable (#152). The node installer
now refuses the variable in every mode, with a one-line message naming
--enrollment-token-stdin, instead of reading it. Standard input and the hidden
prompt remain. A new node without a token is told to pass it on standard input.
The operations upgrade table records the retirement.
@SaladDay
SaladDay deleted the codex/install-sandbox branch October 7, 2026 06:37
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