Skip to content

feat(machinepool): add Agent37 sandbox provider - #708

Open
vishnukool wants to merge 1 commit into
omnara-ai:mainfrom
vishnukool:agent37-sandbox-provider
Open

vishnukool wants to merge 1 commit into
omnara-ai:mainfrom
vishnukool:agent37-sandbox-provider

Conversation

@vishnukool

Copy link
Copy Markdown

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.

  • Configured size. CPU and memory are set per pool, like Modal and Tenki, and must be one of Agent37's sizes: 2 vCPU / 4096 MB, or 4 vCPU with 8192, 16384, or 32768 MB. disk_gb is optional. template is required (a workspace template name, optionally pinned as name@2), and allowed_templates is the allowlist.
  • Duplicate-safe provisioning. Creates only on a machine's first attempt, then adopts the instance by ownership metadata (omnara-installation / omnara-machine), following the E2B and Superserve pattern. Create rejections (4xx, including insufficient_balance, tier_limit, and instance_limit_reached) are permanent; 429, 503 no_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.
  • Daemon launch runs over POST /v1/instances/{id}/exec with the Superserve-style pid-file guard, detaches with setsid, and fails if the daemon exits within two seconds. The machine environment travels with the command rather than being stored on the instance, and ValidateMachineConfig rejects an environment plus startup script that would exceed Agent37's 128 KiB exec body.
  • Runtime protection maps running to running, stopped/sleeping to inactive, transitional statuses to transitional, and failed/deleted (or 404) to terminated.
  • Wiring: provider catalog, OpenAPI enum and generated code, MCP manifest, pool dialog and logo, docs (provider page, overview, pools, machines overview, logo), README, and the live sandbox provider test target.

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 -race for 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-check and docs-openapi-check pass.
  • Frontend: vitest for src/components/org, pnpm typecheck, pnpm lint, and Prettier pass; the SDK was regenerated with pnpm generate:api.
  • TestAgent37ProviderLiveSmoke passes 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 needs AGENT37_API_KEY and OMNARA_AGENT37_TEST_TEMPLATE.
  • Ran the real launcher against https://api.omnara.com/v1 with 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.
  • Ran the template command from the new docs page verbatim and used the resulting template for the live test.

Third-party integration

  • "Allow edits by maintainers" is enabled, so maintainers can finish the pull request on this branch.
  • Test credentials or a test account were shared with the maintainers privately (never in this pull request).
  • We will publish an Omnara setup page in our own docs or guides, linking to the Omnara docs page, and keep it current. Link or planned link: https://www.agent37.com/docs/agents-api/omnara (planned)
  • I understand that maintainers decide whether to merge.

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.
@github-actions github-actions Bot added the feat PRs of type feat (auto-applied from title) label Oct 22, 2026

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

feat PRs of type feat (auto-applied from title)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant