Repository navigation
feat(sandbox-adapter): add Google Cloud Agent Platform provider - #396
Draft
NathanFlurry wants to merge 1 commit into
Draft
NathanFlurry wants to merge 1 commit into
NathanFlurry wants to merge 1 commit into
Conversation
📟 Pip-Boy ·
|
| package (linux-x64-gnu) | @latest |
base | this PR | Δ vs base | packages |
|---|---|---|---|---|---|
@rivet-dev/pi |
392.5 MB | 392.5 MB | 392.6 MB | +27.7 KB (+0.0%) | 220 (0) |
@rivet-dev/sandbox-adapter |
114.5 KB | 114.5 KB | 142.2 KB | +27.7 KB (+24.2%) | 1 (0) |
@sandbox-agent/cli-shared |
27.2 KB | 27.2 KB | 27.2 KB | 0 | 1 (0) |
@sandbox-agent/persist-indexeddb |
12.4 KB | 12.4 KB | 12.4 KB | 0 | 1 (0) |
@sandbox-agent/persist-postgres |
12.3 KB | 12.3 KB | 12.3 KB | 0 | 1 (0) |
@sandbox-agent/persist-rivet |
12.2 KB | 12.2 KB | 12.2 KB | 0 | 1 (0) |
@sandbox-agent/persist-sqlite |
12.3 KB | 12.3 KB | 12.3 KB | 0 | 1 (0) |
@sandbox-agent/react |
41.6 MB | 41.9 MB | 41.9 MB | 0 | 15 (0) |
acp-http-client |
6.7 MB | 6.7 MB | 6.7 MB | 0 | 3 (0) |
sandbox-agent |
31.0 MB | 31.0 MB | 31.0 MB | 0 | 8 (0) |
🧹 Rust dependencies
Skipped: this PR doesn't change any Rust code or dependencies.
🦀 Binaries
Skipped: this PR doesn't change any Rust code.
⏱ Timing
| job | wall time | slowest step |
|---|---|---|
changes |
16s | checkout · 13s |
zizmor |
16s | checkout · 10s |
footprint |
2m12s | Pack the base · 34s |
⏭ self-test |
— | skipped |
⏭ native · ${{ matrix.platform }} |
— | skipped |
⏭ hygiene |
— | skipped |
report |
28s | setup-node · 11s |
🔭 Full CI trace for this commit
One OpenTelemetry trace of CI and Pip-Boy for 25f938d: every job and step, with the sizes above attached. Run after CI finishes.
pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha 25f938d18e272fd092aa73bc187613940c633152Add --otlp <url> to send it to any OTLP/HTTP collector.
Agent instruction: From a rivet-dev/agents checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.
NathanFlurry
force-pushed
the
task-20261114-130155-96f64422-gcp
branch
2 times, most recently
from
November 15, 2026 19:53
13cc4c6 to
0f27518
Compare
Add @rivet-dev/sandbox-adapter/agent-platform. Each Actor gets one Gemini Enterprise Agent Platform shell sandbox, created from a shell template, paused while the Actor sleeps and deleted when it is destroyed. The REST API is called directly with google-auth-library, an optional peer dependency loaded only when no auth is passed. Commands go through the sandbox's :execute proxy to its /exec server, which returns output when a command ends and cannot stop one. Shell sandboxes have no file API, so file operations run as shell commands, with large writes sent in chunks and moved into place. `pnpm test:live` runs tests/agent-platform.live.test.ts against a real shell sandbox. It creates a temporary Agent Engine and template in AGENT_PLATFORM_TEST_PROJECT and deletes them afterwards, unless AGENT_PLATFORM_TEST_TEMPLATE names an existing template. CI never runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NathanFlurry
force-pushed
the
task-20261114-130155-96f64422-gcp
branch
from
November 15, 2026 19:54
0f27518 to
25f938d
Compare
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 a Gemini Enterprise Agent Platform shell sandbox provider at
@rivet-dev/sandbox-adapter/agent-platform. Agent Platform was formerly Vertex AI Agent Engine, and its shell sandboxes went GA on 2026-09-09.Why this product: Agent Compute Engine was announced on 2026-10-22, but it has only a preview sign-up form and no API yet. Cloud Run sandboxes are an in-service CLI, not a remote API. GKE Agent Sandbox is CRDs on your own cluster. That leaves Agent Platform's
reasoningEngines.sandboxEnvironmentsas the hosted sandbox API on GCP.Lifecycle
https://{location}-aiplatform.googleapis.com/v1)POST {engine}/sandboxEnvironmentswith the template, then poll the operation. The sandbox's full resource name is the id.createcan be a function of the Actor context.GET {id}.STATE_PAUSEDgets:resume. Provisioning, pausing, and resuming states are waited on. A 404 or a stopping, deprovisioning, terminated, or deleted sandbox returnsundefined.:pause. 404 andFAILED_PRECONDITIONare ignored.DELETE {id}. 404 is ignored.google-auth-libraryis an optional peer dependency. It is imported only when noauthis passed. Any{ getAccessToken() }works.Commands and files
:executeis a proxy. Its chunks address the shell server at/execon port 8080, the same request Google's Pythonexecute_bashsends. The shell server has these limits, and the provider handles each one:onDatagets stdout and then stderr once the command ends. This is like Daytona.timeoutin whole seconds. A timed-out command fails the request withDEADLINE_EXCEEDEDand returns no output.timedOut: truewith anullexit code and empty output.readFileusesbase64.writeFilesends 48 KiB chunks so each base64 argument stays under Linux's 128 KiB argument limit. Larger files are assembled in a temp file and moved into place.Tests
tests/agent-platform.test.tsruns against a fake Agent Platform REST server. Its:executehandler runs each command in a real localbash -c, so the file scripts, quoting, env export, and the chunk size meet a real shell and the real argument limit. The suite covers:onDataAll 38 package tests pass.
On-demand live test
cd packages/sandbox-adapter AGENT_PLATFORM_TEST_PROJECT=my-project pnpm test:live agent-platformThis runs
tests/agent-platform.live.test.tsagainst a real shell sandbox with Application Default Credentials. It first creates a temporary Agent Engine and shell template in the project (AGENT_PLATFORM_TEST_LOCATION, defaultus-central1) and deletes them afterwards. The project needsaiplatform.googleapis.comenabled. SetAGENT_PLATFORM_TEST_TEMPLATEto reuse an existing template. Without either variable, the test fails with a message instead of using gcloud's default project. A full run takes about 2 minutes.CI never runs it.
vitest.config.tsexcludes*.live.test.ts, and onlyvitest.live.config.ts, used bypnpm test:live, includes it. These two configs are identical to the ones in #395.Live run (us-central1)
All 6 live tests pass. Creating the engine took seconds and the template about 2.5 minutes. The tests cover:
A command takes about 250 ms.
Confirmed:
{name}:executepath works./exec's JSON stdout, soreaddirworks.Fixed from the live run:
FAILED_PRECONDITION:DEADLINE_EXCEEDED ... {"detail":"command exceeded 3s and was killed"}. The provider now reports this astimedOut: true. The fake server returns the same error.aiplatform.googleapis.com, explain how to poll the template's operation for its name, and say that a timed-out command returns no output.Still unverified:
ttl.Package and docs
scripts/test-packed.mjschecks thatdist/agent-platform.jsis packed.examples/docs/sandboxes/agent-platform.ts.🤖 Generated with Claude Code