Skip to content

fix(sandbox): name the generic warm pool on the claim, don't say "default" - #5846

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/generic-warm-pool-name
Aug 7, 2026
Merged

fix(sandbox): name the generic warm pool on the claim, don't say "default"#5846
pedrofrxncx merged 1 commit into
mainfrom
fix/generic-warm-pool-name

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Every new non-tenant sandbox has been failing to start with:

sandbox daemon /_sandbox/config returned 409: {"error":"immutable: cloneUrl"}

Cause

A claim that resolves no tenant pool sets spec.warmpool: "default". No SandboxWarmPool is named that — the sandbox-env chart names the generic pool after the SandboxTemplate (studio-sandbox-prod). The operator falls back to binding any warm pod rendered from the same template, which since #5830 includes the tenant pools.

So a montecarlo claim binds a tenant-electrolux-prod-* pod that is already prewarmed with electrolux's repo. Studio posts its own workload, the daemon sees a different cloneUrl on a config it already holds, and returns 409. Tenant claims are fine: they name their pool and the repo matches by construction.

Confirmed in prod (2026-08-07) from the operator's own bind log — claims bound to pods from both pools over their lifetime:

stephanie-moraes-35ew1is-…  studio-sandbox-prod-25scz  tenant-electrolux-prod-dp4ts  tenant-electrolux-prod-kn2pm …
ephemeral-9e94d92d505ae6c5  studio-sandbox-prod-ck427  tenant-electrolux-prod-qcwst
gabriel-6687tism-…          studio-sandbox-prod-thkjr  tenant-electrolux-prod-snt8l

This is also a tenant-isolation leak, not only an availability bug: another org's pod (with its repo checked out) was handed to an unrelated claim. The 409 is what stopped it from being used.

Fix

Pass the real generic pool name — this.sandboxTemplateName, the same value the chart derives the pool name from — instead of the literal "default".

Testing

  • bun test packages/sandbox/server/provider/agent-sandbox/tenant-pools.test.ts — 20 pass; the "falls back to default" case is inverted to assert the explicit name.
  • Not verified end-to-end in a cluster; the claim's spec.warmpool should read studio-sandbox-prod after deploy, and generic claims should stop binding tenant-* pods.

Summary by cubic

Fixes non-tenant sandbox startups by naming the real generic warm pool on claims instead of "default," preventing accidental binding to tenant pods and 409 cloneUrl errors. Restores availability and preserves tenant isolation.

  • Bug Fixes
    • claimWarmPoolName now accepts genericPoolName and returns it in warm-pool mode when no tenant pool; runner.ts passes this.sandboxTemplateName.
    • Updated tests to assert explicit generic pool naming and preserve "none" when warm-pool mode is off.

Written for commit 83d9896. Summary will update on new commits.

Review in cubic

…ault"

A claim that wants no tenant pool set `spec.warmpool: "default"`. No
SandboxWarmPool is named that — the sandbox-env chart names the generic pool
after the SandboxTemplate — so the operator fell back to binding any warm pod
rendered from that template. With one pool that was invisible. With tenant
pools it hands one org's prewarmed pod, repo already cloned, to another org's
claim, and the daemon rejects the mismatched workload:

  sandbox daemon /_sandbox/config returned 409: {"error":"immutable: cloneUrl"}

Every non-tenant sandbox failed to start; tenant ones worked because their
claims name their pool and the repo matches. Confirmed in prod 2026-08-07 from
the operator's own bind log: claims for montecarlo, gabriel, and `ephemeral-*`
dispatches all bound `tenant-electrolux-prod-*` pods.

Pass the SandboxTemplate name (which is the generic pool's name) instead.
@pedrofrxncx
pedrofrxncx force-pushed the fix/generic-warm-pool-name branch from f019356 to 83d9896 Compare August 7, 2026 11:42
@pedrofrxncx
pedrofrxncx merged commit 2a51344 into main Aug 7, 2026
11 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/generic-warm-pool-name branch August 7, 2026 11:43
decocms Bot pushed a commit that referenced this pull request Aug 7, 2026
PR: #5846 fix(sandbox): name the generic warm pool on the claim, don't say "default"
Bump type: patch

- @decocms/sandbox (packages/sandbox/package.json): 1.44.2 -> 1.44.3
- deploy/helm/sandbox-env (chart 0.12.7) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.44.3

Deploy-Scope: both
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant