Repository navigation
feat(sandbox-adapter): add Agent37 provider - #391
Open
vishnukool wants to merge 3 commits into
Open
vishnukool wants to merge 3 commits into
vishnukool wants to merge 3 commits into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Member
|
@vishnukool nice! looks neat from initial skim of things
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
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.
Adds an Agent37 sandbox provider at
@rivet-dev/sandbox-adapter/agent37. No SDK dependency: Agent37 is a small REST API, so the provider usesnode:https.Lifecycle
POST /v1/instances(template defaults toagent37-base).createcan be a function of the Actor context. The Actor id is stored in the instance metadata.GET /v1/instances/{id}. A stopped instance is started. A sleeping one wakes on its next command. A missing one returnsundefined.POST /v1/instances/{id}/sleep. Memory and processes are kept, only disk is billed.DELETE /v1/instances/{id}Commands
execuses 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, soonDatagets stdout then stderr once, like Daytona. Commands run asroot, 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.tsmirrorsdocker.test.tsand runs whenAGENT37_API_KEYis 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 customcwd. 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.