Repository navigation
feat(machinepool): add Agent37 sandbox provider - #708
Open
vishnukool wants to merge 1 commit into
Open
vishnukool wants to merge 1 commit into
vishnukool wants to merge 1 commit into
Conversation
Add Agent37 as a machine pool provider. Each machine is an Agent37 instance created through the Agents API from a workspace template. - CPU and memory are configured per pool and must be one of Agent37's sizes (2 vCPU / 4 GB, or 4 vCPU with 8, 16, or 32 GB); `disk_gb` is optional. `template` is required and `allowed_templates` is the allowlist. - Provisioning is duplicate-safe: create only on a machine's first attempt, then adopt the instance by ownership metadata. Create rejections (4xx) are permanent; rate limits, no-capacity, and dial failures retry the create. Stopped or sleeping instances are started, and failed ones fail fast so cleanup removes them. - The daemon starts over the exec endpoint with a pid-file guarded, detached launcher. The machine environment travels with the command instead of being stored on the instance. - Runtime protection maps running to running, stopped and sleeping to inactive, and failed or deleted to terminated. - Wire Agent37 into the provider catalog, OpenAPI enum and generated code, MCP manifest, pool dialog and logo, docs, README, and the live sandbox provider test target.
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.
Summary
Adds Agent37 as a machine pool provider. Each machine is an Agent37 instance (an always-on Linux sandbox with a persistent disk) created through the Agents API from a workspace template.
disk_gbis optional.templateis required (a workspace template name, optionally pinned asname@2), andallowed_templatesis the allowlist.omnara-installation/omnara-machine), following the E2B and Superserve pattern. Create rejections (4xx, includinginsufficient_balance,tier_limit, andinstance_limit_reached) are permanent; 429, 503no_capacity, and dial failures retry the create. Stopped or sleeping instances are started; failed ones fail fast so cleanup deletes them; size mismatches are permanent.POST /v1/instances/{id}/execwith the Superserve-style pid-file guard, detaches withsetsid, and fails if the daemon exits within two seconds. The machine environment travels with the command rather than being stored on the instance, andValidateMachineConfigrejects an environment plus startup script that would exceed Agent37's 128 KiB exec body.runningto running,stopped/sleepingto inactive, transitional statuses to transitional, andfailed/deleted(or 404) to terminated.Idle sleep is left off: Agent37's auto-sleep is driven by inbound traffic and exec, which the daemon's outbound connection does not generate, so Omnara-created instances stay on until Omnara deletes them.
Testing
go test -racefor the new package,./internal/machinepool/..., the OpenAPI contract test, and the MCP manifest test.golangci-lint(repo config, all build tags) reports 0 issues on./internal/machinepool/...and./internal/httpapi/....openapi-checkanddocs-openapi-checkpass.vitestforsrc/components/org,pnpm typecheck,pnpm lint, and Prettier pass; the SDK was regenerated withpnpm generate:api.TestAgent37ProviderLiveSmokepasses against the production Agents API (about 9 s): connection check, create, idempotent re-provision, daemon launch (verified running in the instance), inspect, single and bulk runtime observation, missing-instance observation, foreign-installation delete refused, delete, and repeat delete. It uses a stand-in daemon because its machine token is fake, like the Superserve test. It needsAGENT37_API_KEYandOMNARA_AGENT37_TEST_TEMPLATE.https://api.omnara.com/v1with a fake token: the startup script ran, the installer reached Omnara and was rejected with 401, and the launcher reported "omnara daemon exited early" with the log tail.Third-party integration