Repository navigation
refactor(cloud-agent): remove shared sandbox allocation - #9781
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryRe-reviewed the rebased HEAD ( Assumptions: Files Reviewed (51 files)
Previous Review Summary (commit 8143640)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 8143640)Status: No Issues Found | Recommendation: Merge Executive SummaryThe shared-sandbox removal is internally consistent: new-session paths reject Assumptions: Files Reviewed (51 files)
Reviewed by deepseek-flash-latest · Input: 134.5K · Output: 20K · Cached: 3.7M Review guidance: REVIEW.md from base branch |
One sandbox serves one workspace. Nothing creates an owner-scoped shared sandbox any more: - generateSandboxId and selectControlPlaneSandbox derive only per-session keys and reject an explicit cloudflare-shared allocation. - Remove the shared route, its failover KV namespace binding (SHARED_SANDBOX_OVERRIDES) and PER_SESSION_SANDBOX_ORG_IDS. - Remove the shared-only subagent and spawn-authority checks from registration; a recorded shared kind in the operation ledger now fails with the retired-allocation message instead of being replayed. Stored data keeps decoding: the cloudflare-shared allocation, the shared sandbox kind, the metadata sandboxRoute and the legacy shared key classes stay in the schemas as legacy decode only. Such sessions ran on the retired Cloudflare Sandbox runtime, so they already stop with the retired-runtime message; saved settings, environments and triggers that name the shared allocation fall through to the default.
8143640 to
42d4b62
Compare
Summary
One sandbox serves one workspace. #9689 already made
cloudflare-sharedunselectable, so this PR removes the shared sandbox code that nothing reaches now. Users see no difference.generateSandboxIdandselectControlPlaneSandboxderive only per-session keys. An explicitcloudflare-sharedallocation fails with the retired-allocation message.shared-sandbox-route.ts), theSHARED_SANDBOX_OVERRIDESKV binding andPER_SESSION_SANDBOX_ORG_IDS.docs/control-plane.mdand the related READMEs now state that one sandbox serves one workspace.Stored data still decodes. The
cloudflare-sharedallocation, the shared sandbox kind, the metadatasandboxRouteand the legacy shared key classes stay in the schemas as legacy decode only. Those sessions ran on the retired Cloudflare Sandbox runtime, so they already stop with the retired-runtime message. Saved settings, environments and triggers that name the shared allocation use the default.No PostgreSQL migration and no public API change.
Verification
cloud-agent-nexttypecheck and lint pass.pnpm run build:wrapper): 790 passed, 2 skipped.worker-utilstests: 1198 passed.Visual Changes
N/A
Reviewer Notes
SHARED_SANDBOX_OVERRIDESKV namespace and thePER_SESSION_SANDBOX_ORG_IDSsecret.worker-configuration.d.tswas edited by hand. Its header hash is stale; regenerate it with the private env file.apps/web/src/routers/admin/session-container-telemetry.ts) labels everysbx-ID as "Shared container". The fix must read the stored sandbox kind, because the ID prefix does not identify it.cloudflare-shared, and the request then fails as retired. Narrowing them changescatalog.json, so it is left for a separate change.sharedaction and the session-ingestkind: 'shared'mean sibling chats in one workspace, not a shared sandbox. They are not changed.