[feat] Bake harnesses into Daytona snapshot, flip Pi install default#5046
[feat] Bake harnesses into Daytona snapshot, flip Pi install default#5046junaway wants to merge 2 commits into
Conversation
…t test The heartbeat contract dropped the status field (the API derives ended server-side when the heartbeat stops); the test still asserted it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…efault The rivetdev/sandbox-agent:*-full base image already bakes claude, codex, and opencode (native binaries + ACP adapters) via its own `install-agent --all` build layer, verified by pulling the image manifest and inspecting its final layer. Only the standalone `pi` CLI binary was missing (the pi-acp adapter is already baked). build_snapshot.py now documents and verifies this instead of assuming only Pi is baked, and only does real install work for Pi. Also fixes the install-default footgun in daytona.ts: DAYTONA_PI_INSTALL defaulted to install-ON (`!== "false"`), so any Daytona run without the opt-out flag paid a ~150s npm install per sandbox even though the snapshot exists to avoid exactly that. Flip the default to install-OFF (`=== "true"`), backward compatible since the old opt-out spelling (`=false`) still resolves to off. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the Daytona sandbox snapshot build and runner behavior so Pi no longer installs at session start by default (assuming the snapshot already bakes Pi), and adjusts related tests/docs. It also updates the session heartbeat unit test to reflect a contract change where status is no longer sent by the runner.
Changes:
- Flip Pi runtime install behavior to opt-in (
AGENTA_AGENT_SANDBOX_PI_INSTALLED === "true") and add unit tests for the new default. - Update Daytona snapshot docs/build script to reflect which harness components are baked and add base-image verification steps.
- Update the alive-heartbeat unit test to assert
statusis no longer included in the final heartbeat payload.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/runner/tests/unit/session-alive.test.ts | Updates heartbeat test expectations to match the runner → server heartbeat contract (no status in payload). |
| services/runner/tests/unit/sandbox-agent-daytona.test.ts | Adds coverage for the new default/compat behavior of DAYTONA_PI_INSTALL. |
| services/runner/src/engines/sandbox_agent/daytona.ts | Flips Pi runtime install from opt-out to opt-in and updates inline documentation. |
| services/runner/sandbox-images/daytona/README.md | Documents what the base -full image bakes and how the Pi install lever now behaves. |
| services/runner/sandbox-images/daytona/build_snapshot.py | Verifies baked harness binaries in the base image and installs the pi CLI into the snapshot. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| out to -- so this script's only real job is adding that. Everything else below is a | ||
| verify-and-mark step, not a re-install: we set the `_INSTALLED` marker for | ||
| claude/codex/opencode too so `daytona.ts` never re-runs their daemon auto-install | ||
| (currently a no-op safety net at runtime, since the daemon's own install is idempotent, | ||
| but skipping it avoids the "is it already there" round-trip on every run) and never pays | ||
| their (far larger) per-run cost were that ever to regress. Set the runner service to use |
| DAYTONA_SNAPSHOT=agenta-sandbox-pi | ||
| AGENTA_AGENT_SANDBOX_PI_INSTALLED=false | ||
| AGENTA_AGENT_SANDBOX_PI_INSTALLED=true | ||
| AGENTA_AGENT_SANDBOX_CODEX_INSTALLED=true | ||
| AGENTA_AGENT_SANDBOX_OPENCODE_INSTALLED=true | ||
| AGENTA_AGENT_SANDBOX_CLAUDE_INSTALLED=true |
Context
Auditing the Daytona image build revealed the
-fullbase snapshot already bakes Claude, Codex, and OpenCode (verified against the Docker Hub registry API layer listing) — only Pi was missing, and it defaulted to installing at runtime on every session (DAYTONA_PI_INSTALL !== "false", i.e. install-on by default), which was an unnecessary per-run cost for the one harness that didn't need it baked.Changes
build_snapshot.pynow verifies the three already-baked harnesses are present and installs only Pi into the snapshot.daytona.ts'sDAYTONA_PI_INSTALLflag flips from opt-out (!== "false") to opt-in (=== "true"), so the safe default after baking is no runtime install.Tests / notes
sandbox-agent-daytona.test.tsfor the new default.