Repository navigation
fix(adapters): gcp-sandboxes forks keep the owner, no unmovable TTL, request faults spare the pool - #135
Merged
Conversation
…request faults spare the pool - A snapshot takes its source sandbox's owner. Google restores only from a snapshot of the same owner, and forks are created with the installation as owner, so forks from Google-default-owner snapshots were refused. - No Google ttl on sandboxes. It can never move (no update method), so extending a sandbox's TTL left Google to delete it at the original deadline, and a sandbox without a TTL was deleted after 7 days. - On create, a request's template that Google does not have or refuses, and a snapshot that is gone, expired or of another owner, are invalid_request; a create or start that outlasts its wait is sandbox_failed. Both marked the shared pool unhealthy before. The fake now enforces snapshot ownership and refuses unknown templates and snapshots. Tested against the fake server only; nothing ran on Google Cloud. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jalil <reachjalil@gmail.com>
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.
An independent review of the experimental
gcp-sandboxesadapter (Agent Platform sandboxes) found three problems that would bite on first real use. Each claim was checked against Google's REST reference and the scheduler's code before fixing.Fixes
Forks were refused. Google's reference says "A Sandbox can only be restored from a snapshot that belongs to the same owner. If not set, sandbox will be created as the default owner." Sandboxes are created with
ownerset to the installation, but:snapshotsent no owner. A snapshot now takes its source's owner.A TTL extension lost the sandbox. Sandboxes have no update method, so a
ttlset at create can never move. The adapter isn't anExpirer, and the server leaves such backends alone on a TTL change, so Google deleted the sandbox at the original deadline while Differently still counted it alive. A sandbox without a TTL was deleted after the adapter's own 7-day default; Google's docs say a sandbox withoutttlis never deleted automatically. The adapter now sets no Google TTL. Differently's audited expiry deletes the sandbox, and the reconciler deletes orphans. The trade-off: no provider-side backstop if the control plane is gone for good. This is documented.One sandbox's failure marked the pool unhealthy.
scheduler.retrymarks a pool unhealthy for anything except capacity,sandbox_failedandinvalid_request. On create, two cases now fail just that sandbox:invalid_request.sandbox_failed.The pool's own template missing still counts against the pool.
Tests
make verifypasses.Not run: nothing here has run against Google Cloud.
TestLiveGCPSandboxes(#132) is still unrun.The review's lower-priority items are left for later: large
ReadFileresponses through:execute, theSTATE_STOPPINGmapping, holding the token lock during a fetch, and more credential types.🤖 Generated with Claude Code