feat(eval): add Modal and Daytona runtime providers for per-rollout cloud sandboxes#423
Merged
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>
Add RuntimeConfig to allow tasks to specify runtime images, compute resources, and lifecycle limits. This feature enables more granular control over task execution environments, accommodating varying requirements within the same taskset. Update relevant classes and methods to support this new configuration, including integration into task payloads and validation tests.
984917b to
420718b
Compare
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 d3775af. 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
Touches core eval placement (container/cloud provisioning, credentials, SSH tunneling) and changes DockerRuntime CLI shape; failures are mostly isolated per rollout but misconfiguration could affect parallel batch runs.
Overview
Adds portable per-task launch requirements via
RuntimeConfig(image,RuntimeResources,RuntimeLimits) onTask, wired through platform sync and documented in the types reference.Runtimenow carries the effective config after provider defaults merge with row-level overrides viawith_overrides.DockerRuntimeis refactored aroundruntime_config(CPU/memory/GPU count →docker runflags) and surfaces unsupported fields with clear errors.ModalRuntimeandDaytonaRuntimeare newProviders that spin up isolated cloud sandboxes per rollout (Modal TCP tunnels; Daytona env serve + SSH local-forward), both honoringruntime_configwhere the backend allows.LocalRuntimeandHUDRuntimeexplicitly reject task-levelruntime_configfor now.Public exports include the runtime config types; optional
[modal]and[daytona]extras gate cloud SDK deps. Provider contract tests cover Docker/Modal/Daytona mapping and validation.Reviewed by Cursor Bugbot for commit ae79946. Bugbot is set up for automated code reviews on this repo. Configure here.