Repository navigation
feat(coreweave): create provider - #406
Merged
earakely-scale merged 11 commits intoOct 30, 2026
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Re-lock uv.lock on main's lockfile, keeping cwsandbox at the tested 1.19.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… pin a container's image before awaiting Exposed-port domains go into CoreWeaveSandboxProvider.EGRESS_HOSTS, so all_sandbox_egress_hosts() gives them to every provider's allowlists and a restricted agent on another provider reaches a CoreWeave environment. create_container now reads the pinned digest before awaiting the image store, so another deploy preparing the same tag at another digest meanwhile can't change the image it runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t status as exit -1 cwsandbox raises a bare SandboxExecutionError when an exec stream closes with no exit status. The sandbox contract reports a dropped transport as exit -1, which callers retry for idempotent commands (exec_script's max_retries, wait_for_vm), so exec now returns -1 for it instead of raising. A failed command's SandboxExecutionError, which carries its result, and SandboxNotRunningError still propagate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fter its cleanup stops waiting When a cancelled or failed create's start request is still unanswered after the settle wait, its cleanup looked for the sandbox by tag once and stopped. A sandbox the request made afterwards ran until its max lifetime. The cleanup now watches the pending request and deletes the sandbox once it answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s before failing A cancelled create's start request that answers after cleanup stopped waiting had its sandbox deleted only when it answered with an id. One that failed with its response lost, after the server had made the sandbox, left it running until its max lifetime. The late cleanup now looks the sandbox up by the create's tag in that case, as the cleanup that waited does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
Adds a built-in
coreweavesandbox provider so AgentEnv can run agents and environments on CoreWeave Sandboxes. Install it withagentenv-framework[coreweave]and select it through the existing sandbox configuration. One provider accepts either CoreWeave or W&B credentials throughenv:orsecret:references.Closes #301.
Both modes support command execution, file transfers, public HTTPS endpoints, egress policy, reconnect and idempotent teardown. The Sandbox API keeps a deleted sandbox's record, so reconnect treats a sandbox that is terminating, completed, failed or terminated as not found. The requested timeout sets the sandbox's hard lifetime. Failed or cancelled creation attempts reclaim the sandbox; cancellation waits for cleanup rather than leaving it to a background callback. Reconnect identifies the mode from the API's echoed container specification.
The extra requires
cwsandbox>=1.19.6,<2, locked to 1.19.6. That release raises an error when an exec stream ends without an exit status. The provider propagates that error rather than reporting success or automatically retrying the command.Behavior and limits for reviewers:
enable_docker=Truemust run on an explicit VM-mode sandbox.sh,mkdir,headandtar, and are limited to about 256 MiB. File payloads are fetched by the client before upload; VM transfers use permitted signed downloads or exec stdin.disk_size_gbis logged as ignored. VM Docker storage rounds upward to whole GB with a 20 GB minimum. Cancellation cleanup may take about 30 seconds plus deletion round trips.Site documentation should cover installation and configuration, both sandbox modes, authentication, image requirements, endpoint exposure, egress, file-transfer limits and the prepared Docker host image. Provider maintenance and host-image publishing ownership remain to be settled before submission.
How it was tested
All checks below ran on the final branch (based on
3796d4c) with SDK 1.19.6.116 CoreWeave unit tests passed, covering both modes, deployment paths, digest-pinned images, startup requests, reconnect, ended sandboxes, policy and cleanup:
1,433 passed, 14 skipped across the broader image and deployment tests.
Broader test command
make unit-test: 11,969 passed, 66 skipped, 1 failed. The failure istst/unit/agents/hermes/test_hermes_bridge.py::test_the_event_pipe_is_not_left_open_in_the_server, which reads/proc/self/fdand fails on macOS regardless of this change.uv lock --check,make lintand plugin API compatibility passed:.venv/bin/python .github/scripts/check_plugin_api.py \ --base 3796d4c --title 'feat(sandbox): add the CoreWeave provider'All 7 CoreWeave live smoke tests passed through the real API: VM nested Docker, public ports, uploads and reconnect; allowlisted VM and native-container egress (an allowed host reachable, others blocked, policy read back on reconnect); native image startup with its own entrypoint, env and file writes; file writes as a non-root image user (
nginx-unprivileged), with a write the user cannot make failing; and the container, VM and VM Docker architectures and VM runtime class matching what the sandbox reports. The first run found that a deleted sandbox reconnected instead of raisingSandboxNotFoundError; the fix and its unit tests are in this branch.agent-env run hello --sandbox coreweaveandagent-env run echo-mcp --sandbox coreweavepassed, both recorded on CoreWeave sandboxes and torn down.CoreWeave gateway and task-step integration cases (
-k coreweaveovertst/integration/env/gateway/gateway_test.pyandtst/integration/env/task_step/task_steps_test.py, no model endpoint): 12 passed, 67 skipped with declared capability reasons (64mcp_server_sources, 2default_a2a_agent, 1model_endpoint_configured).test_gateway_with_multi_mcp_server[coreweave]failed once withInternal error from Corefrom the Sandbox API during an image upload, and passed on rerun.Not run: the 64 gateway clock cases that build MCP servers from
AGENT_ENV_TEST_MCP_SERVERS_DIR, and the cases needing a registered default agent or a model endpoint.Both Claude and Codex used to create


Confidence Score: 5/5
The PR appears safe to merge, with the outstanding late-create cleanup finding addressed.Summary
Adds CoreWeave sandboxes in two modes:
The latest change completes late-start cleanup when the create response is lost. No new actionable issues were found.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[CoreWeave provider] --> B[Native container] A --> C[Docker-capable VM] B --> D[Requested image] C --> E[Gateway and Docker workloads] A --> F[Failed or cancelled create] F --> G[Delete by ID or unique tag]Reviews (5) · Last reviewed commit: "fix(sandbox): find by its tag the sandbo..." · Reviewed by Greptile