feat(cloud-agent-next): introduce provider-neutral agent sandbox structure#4552
feat(cloud-agent-next): introduce provider-neutral agent sandbox structure#4552eshurakov wants to merge 3 commits into
Conversation
…cture Add the structural seams for supporting multiple sandbox providers: a sandboxProvider identity in session metadata with a static capability matrix, a provider factory and lifecycle-reconciliation seam, a typed AgentSandboxUnavailableError taxonomy surfaced as a permanent SANDBOX_CAPABILITY_UNAVAILABLE delivery failure, terminal capability-unavailable outcomes, transport-only WrapperClient construction for providers without a public wrapper port, provider selection at session registration, and a durable session deletion intent that fences runtime use and supports deferred provider-side deletion. Cloudflare remains the only provider. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental changes are limited to local E2E test-harness documentation and timeout tuning (DEBUG.md, README.md, AGENTS.md, lifecycle.ts, client.ts, smoke.ts) with no application/runtime code affected; the previously flagged deferred-deletion purge issue in Files Reviewed (6 files)
Previous Review Summaries (2 snapshots, latest commit b68565d)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit b68565d)Status: No Issues Found | Recommendation: Merge Executive SummaryThe deferred-deletion purge fix correctly retains provider entry keys during Files Reviewed (2 files)
Previous review (commit 18b98cc)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe deferred-deletion path in Overview
Issue Details (click to expand)WARNING
Files Reviewed (36 files)
Reviewed by claude-sonnet-5 · Input: 36 · Output: 5.9K · Cached: 980.8K Review guidance: REVIEW.md from base branch |
…ugh payload purge purgeDeletedSessionPayload() only retained the deletion-intent fence, so the deferred-deletion branch deleted the provider entries it had just persisted. Pass the plan's entry keys as additional retained keys and cover the path with an integration test.
Increase per-scenario timeout from 90s to 120s to give margin over the 3x30s wrapper startup path under Docker contention. Add pre-run cleanup of stale sandbox containers to prevent cross-run accumulation that degrades Docker Desktop performance. Document three failure modes discovered during local validation: - Non-zero portOffset sessions require WORKER_URL/FAKE_LLM_URL overrides - git-token-service-dev missing from dev-registry (stale wrangler process) - @cloudflare/containers 503 container control connection under Docker load
Summary
Add the structural seams for supporting multiple sandbox providers in
cloud-agent-next, with no change to current runtime behavior. Cloudflare remains the only provider today; these seams replace hard-coded provider assumptions with a typed capability matrix so additional providers can be added behind a single boundary.sandboxProvideridentity in session metadata (defaulting tocloudflare), backed by a staticPROVIDER_CAPABILITIESmatrix. Metadata validation now gates capabilities (e.g. devcontainer) via that table instead of provider name checks.AgentSandboxLifecyclereconciliation seam for settling interrupted runtime creation and driving deletion to a terminal state. Cloudflare returns no-ops since its runtimes are locally addressed.AgentSandboxUnavailableErrortaxonomy, surfaced as a permanentSANDBOX_CAPABILITY_UNAVAILABLEdelivery failure, with terminalcapability-unavailableoutcomes (e.g. terminal access).WrapperClientconstruction for providers that expose no public wrapper port.selectSandboxForNewSession.session_deletion_intent) that fences further runtime use, survives payload purge, and supports deferred provider-side deletion reconciled via alarms.Verification
Visual Changes
N/A
Reviewer Notes
format:check,lint,typecheck, unit tests (98 files / 2213 passed), integration tests (24 files / 214 passed).persistence/CloudAgentSession.ts, and theSANDBOX_CAPABILITY_UNAVAILABLEpermanent-failure surfacing acrossexecution/errors.ts+execution/orchestrator.ts.