feat(eval): add Modal and Daytona runtime providers for per-rollout cloud sandboxes#423
Open
lukass16 wants to merge 8 commits into
Open
feat(eval): add Modal and Daytona runtime providers for per-rollout cloud sandboxes#423lukass16 wants to merge 8 commits into
lukass16 wants to merge 8 commits into
Conversation
Add ModalRuntime as a Provider alongside DockerRuntime: resolve image once (from_name or lazy build), create an isolated Sandbox per rollout, expose the env control channel over raw TCP, terminate on exit. Export from hud.eval and add optional [modal] extra.
…oxes Add DaytonaRuntime as a Provider alongside ModalRuntime: resolve snapshot once (build from image if missing), create an isolated sandbox per rollout, start the env server in a background session, reach it via an asyncssh local-forward (Daytona exposes only HTTPS previews, connect dials tcp://), delete on exit. workdir defaults to /app to match the scaffolded Dockerfile.hud. Export from hud.eval and add optional [daytona] extra.
Environment(capabilities=[...]) called add_capability() before _hooks_done was initialized, raising AttributeError; move the flag init above the loop. Also apply ruff format to satisfy CI (runtime.py, claude sdk agent, cli init). Co-authored-by: Cursor <cursoragent@cursor.com>
The env server binds all interfaces inside the sandbox; the tunnel is the only ingress, so the all-interfaces bind is intentional. Co-authored-by: Cursor <cursoragent@cursor.com>
…smatch The default command hardcoded --port 8765 while the SSH forward used the port arg, so a non-default port left the tunnel pointing at a dead port. Build the default command from port; an explicit command still overrides. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5977d5b. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue
The engine could place rollouts locally, in Docker, on a borrowed substrate, or
HUD-hosted — but not on on-demand cloud sandboxes. We want isolated, parallel
cloud envs (Modal, Daytona) per rollout.
Solution
Two new
Providers inhud/eval/runtime.py, same shape asDockerRuntime(acquire → yield
Runtime→ tear down), sorollout()/connect()/scheduler areunchanged:
ModalRuntime—Sandbox.createper rollout from a pre-built image, controlchannel over raw TCP (
unencrypted_ports), terminate on exit. Image resolves oncebehind a lock (
from_name, or lazyimage=build) so concurrent rollouts can'trace a build.
DaytonaRuntime— sandbox from a snapshot (built once fromimage=ifmissing), env server in a background session, reached via an
asyncsshlocal-forward (Daytona exposes only HTTPS previews;
connect()dialstcp://).SSH token is internal; users only need
DAYTONA_API_KEY.workdirdefaults to/app(scaffold WORKDIR).Single user handle is the image/snapshot name. Both exported from
hud.eval, gatedbehind optional
[modal]/[daytona]extras. Addsmodal_deploy.pyto build+publishthe libero image.
Outcome / Verification
Taskset.run(runtime=...); no engine/client/protocol changes.--runtime modal|daytonaCLI flag,ws://transport (drop the SSHhop), warm-pool to amortize cold start.
Note
Medium Risk
New cloud provisioning paths depend on external APIs, credentials, and SSH tunneling (Daytona disables host key verification); failures could leak resources or block parallel rollouts, but the existing rollout/connect contract is unchanged.
Overview
Adds Modal and Daytona as eval placement providers alongside local/Docker/HUD-hosted, so
Task.run/Taskset.run(..., runtime=...)can spin up one isolated cloud sandbox per rollout without changingrollout()orconnect().ModalRuntimecreates a ModalSandboxfrom a named image (or a one-time lazyimage=build behind a lock), serveshud serve env.pyon a tunneled raw TCP port, and terminates the sandbox on exit.DaytonaRuntimecreates an ephemeral sandbox from a snapshot (optionally creating the snapshot fromimage=if missing), starts the env server in a background session, and exposes the control channel viaasyncsshlocal port-forward to loopback because Daytona only offers HTTPS previews. Both yield aRuntimewith provider metadata for teardown.ModalRuntimeandDaytonaRuntimeare exported fromhud.eval; optional[modal]and[daytona]extras declare the new dependencies. Smaller fixes:Environmentregisters capabilities after_started/_hooks_doneare initialized; Windows CLI re-wraps stdout/stderr as UTF-8 for Rich; trivial formatting in the Claude SDK agent.Reviewed by Cursor Bugbot for commit 4a31f50. Bugbot is set up for automated code reviews on this repo. Configure here.