Skip to content

[feat] Bake harnesses into Daytona snapshot, flip Pi install default#5046

Draft
junaway wants to merge 2 commits into
big-agentsfrom
chore/bake-daytona-harnesses
Draft

[feat] Bake harnesses into Daytona snapshot, flip Pi install default#5046
junaway wants to merge 2 commits into
big-agentsfrom
chore/bake-daytona-harnesses

Conversation

@junaway

@junaway junaway commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Context

Auditing the Daytona image build revealed the -full base 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.py now verifies the three already-baked harnesses are present and installs only Pi into the snapshot. daytona.ts's DAYTONA_PI_INSTALL flag flips from opt-out (!== "false") to opt-in (=== "true"), so the safe default after baking is no runtime install.

Tests / notes

  • Updated sandbox-agent-daytona.test.ts for the new default.
  • No behavior change for Claude/Codex/OpenCode on Daytona; only Pi's install path changes.

jp-agenta and others added 2 commits July 2, 2026 15:10
…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>
Copilot AI review requested due to automatic review settings July 2, 2026 21:41
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 2, 2026
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 2, 2026 9:41pm

Request Review

@dosubot dosubot Bot added the enhancement New feature or request label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d254caf-49ed-4cef-a457-62280350a65e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bake-daytona-harnesses

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 status is 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.

Comment on lines +14 to +19
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
Comment on lines 22 to +26
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
@jp-agenta jp-agenta marked this pull request as draft July 2, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants