Skip to content

feat(sandbox-adapter): add Agent37 provider - #391

Open
vishnukool wants to merge 3 commits into
rivet-dev:mainfrom
vishnukool:add-agent37-provider
Open

vishnukool wants to merge 3 commits into
rivet-dev:mainfrom
vishnukool:add-agent37-provider

Conversation

@vishnukool

Copy link
Copy Markdown

Adds an Agent37 sandbox provider at @rivet-dev/sandbox-adapter/agent37. No SDK dependency: Agent37 is a small REST API, so the provider uses node:https.

sandbox: agent37Provider(),
// or
sandbox: agent37Provider({ create: { template: "agent37-base", resources: { cpu: 4, memory: 8 } } }),

Lifecycle

Event Agent37 call
First tool use POST /v1/instances (template defaults to agent37-base). create can be a function of the Actor context. The Actor id is stored in the instance metadata.
Wake GET /v1/instances/{id}. A stopped instance is started. A sleeping one wakes on its next command. A missing one returns undefined.
Sleep POST /v1/instances/{id}/sleep. Memory and processes are kept, only disk is billed.
Destroy DELETE /v1/instances/{id}

Commands

exec uses the same wrapper and kill script as the Docker provider: the wrapper records the shell's pid, and a timeout or abort runs the kill script in a second exec, which stops the whole process tree. Agent37 returns output when the command ends, so onData gets stdout then stderr once, like Daytona. Commands run as root, since Agent37 images have no sudo.

Files go through exec as base64, in blocks that stay under the API's 1 MB request and 512 KB output limits, so reads are byte exact and writes of any size work.

Testing

tests/agent37.test.ts mirrors docker.test.ts and runs when AGENT37_API_KEY is set (skipped otherwise). 11/11 pass against production: exec with cwd/env/exit code, abort and timeout killing the command, file round trips (unicode, hidden files, odd names, a 1.4 MB file, binary reads), a write into a missing directory failing cleanly, sleep then reconnect keeping files, destroy, and a custom cwd. Removing the kill makes the timeout test fail.

Happy to share a funded API key privately if you want to run it.

cc @eersnington, since you pointed the boxd PR at packages/sandbox-adapter, this one starts there.

@mintlify

mintlify Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit c42dae9.

Approve preview

@eersnington

Copy link
Copy Markdown
Member

@vishnukool nice! looks neat from initial skim of things

Happy to share a funded API key privately if you want to run it.

would appreciate that. I'll signup later down today to try this out. also do you wanna get in touch with nathan or nicholas 👀 (they respond on X)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants