Skip to content

feat(cloud-agent-next): raise disk to 20 GB for live containment sandbox classes - #7983

Merged
eshurakov merged 3 commits into
mainfrom
feat/cloud-agent-sandbox-disk-20gb
Oct 19, 2026
Merged

eshurakov merged 3 commits into
mainfrom
feat/cloud-agent-sandbox-disk-20gb

Conversation

@eshurakov

@eshurakov eshurakov commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Raises the disk of the Cloud Agent container classes that carry live traffic to the platform maximum 20 GB, keeping each class's current vCPU and memory.

Motivation: code review sessions were failing with Workspace setup failed: sandbox storage full during git checkout on repositories whose working tree exceeds the class tier (code review had 8 GB). Cloudflare custom instance types allow up to 20 GB disk independent of vCPU/memory (max 4 vCPU, 12 GiB memory, min 3 GiB per vCPU), so this is a disk-only change.

Scope is limited to classes with live instances (Cloudflare dashboard):

Class Live instances vCPU / memory disk before → after
SandboxCodeReviewContainment 21 1 / 4096 8 → 20 GB
SandboxSmallContainment 5 2 / 6144 10 → 20 GB
SandboxContainment 60 4 / 12288 20 GB (unchanged)

Not changed: Sandbox, SandboxSmall, SandboxDIND, and the non-containment SandboxCodeReview all report 0 live instances (every non-contained session runs in Sandbox, and credential containment routes traffic to the containment classes), so they keep their lower tiers. Dev overrides are unchanged. SandboxContainers uses the Durable Object policy with runtime-selected named instance types (standard-3/standard-4), so its disk is chosen per allocation, not here.

This PR also removes the config-snapshot tests so that a capacity change no longer requires editing test expectations:

  • deleted container-capacity-parity.test.ts
  • deleted the SKU, legacy-capacity, containers-capacity, and Vercel capacity/identity snapshots in container-usage-context.test.ts
  • behavior tests kept (rejection of unsupported sizes, class classification, capacity-routing dispatch, attribution); the routing test now compares against the exported tables instead of duplicating values

The three sources (wrangler.jsonc, SANDBOX_CAPACITIES, the web container-capacity table) are now kept in sync manually, and the comments in the two code files say so.

Changed files:

  • services/cloud-agent-next/wrangler.jsonc
  • services/cloud-agent-next/src/container-usage-context.ts
  • services/cloud-agent-next/src/container-usage-context.test.ts
  • services/cloud-agent-next/src/container-capacity-parity.test.ts (deleted)
  • apps/web/src/lib/cloudflare/container-capacity.ts

Verification

No manual testing: this is a deployed capacity configuration change and deployment is operator-driven.

Automated checks run:

  • pnpm --filter cloud-agent-next run test — pass (223 files, 6808 passed, 3 skipped).
  • pnpm --filter cloud-agent-next run typecheck — pass.
  • pnpm --filter cloud-agent-next run lint — pass (0 warnings, 0 errors).
  • oxfmt --list-different on the changed files — clean.

Not covered: no live sandbox was started, so the effective Cloudflare capacity is asserted by config only, not observed at runtime.

Visual Changes

N/A

Reviewer Notes

  • Disk only; vCPU and memory are untouched, so the 3 GiB-per-vCPU ratio still holds.
  • Heads-up on limits: at 20 GB each, the account's 30 TB concurrent-disk ceiling is reached at ~1,500 concurrent containers, which equals SandboxSmallContainment's max_instances.
  • Dropping container-capacity-parity.test.ts removes the only automated guard that wrangler.jsonc, SANDBOX_CAPACITIES, and the web capacity table agree. They now rely on manual sync and the comments.
  • This raises headroom but does not fix repositories that commit build output (e.g. a tracked src-tauri/target/): a sufficiently large checkout can still exceed 20 GB.

Every production container class now requests the platform maximum
20 GB disk while keeping its current vCPU and memory. Large repository
checkouts were previously bounded by the class tier (8 GB for code
review, 10 GB for the small classes), which failed with
"sandbox storage full" during git checkout.

The three mirrored capacity sources stay aligned:
- services/cloud-agent-next/wrangler.jsonc
- services/cloud-agent-next/src/container-usage-context.ts
- apps/web/src/lib/cloudflare/container-capacity.ts
and container-capacity-parity.test.ts asserts the agreement.
@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The follow-up commit removes the config-snapshot tests (and the deleted parity test) that previously failed against the 20 GB containment disks, leaving the changed tests, imports, and comments internally consistent; no new defects are visible in the incremental diff.

Files Reviewed (4 files)
  • apps/web/src/lib/cloudflare/container-capacity.ts (comment-only change)
  • services/cloud-agent-next/src/container-capacity-parity.test.ts (deleted)
  • services/cloud-agent-next/src/container-usage-context.test.ts (snapshot tests removed, remaining imports all used)
  • services/cloud-agent-next/src/container-usage-context.ts (comment-only change)

Previous findings re-verified against HEAD 8510dfac: the stale SANDBOX_CAPACITIES snapshot no longer exists (resolved by deleting the snapshot tests), and the wrangler.jsonc disk comment is now correctly scoped to the live containment classes. Deleting container-capacity-parity.test.ts removes the only automated guard that the three mirrored capacity sources agree; this is an intentional, PR-documented trade-off rather than a defect.

Previous Review Summaries (2 snapshots, latest commit fe8c9f3)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit fe8c9f3)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The new commit narrowed the 20 GB disk bump to the containment classes, but the matching capacity snapshot in container-usage-context.test.ts was not updated for SandboxSmallContainment/SandboxCodeReviewContainment, so pnpm --filter cloud-agent-next test fails in CI.

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
services/cloud-agent-next/src/container-usage-context.ts 59, 62 SANDBOX_CAPACITIES now sets SandboxSmallContainment and SandboxCodeReviewContainment to 20 GB, but container-usage-context.test.ts:333,336 still snapshots 10 GB / 8 GB, so the unit part of the cloud-agent-next CI job fails.
Files Reviewed (4 files)
  • apps/web/src/lib/cloudflare/container-capacity.ts - no issues; the split containment/standard cases match the wrangler and usage-metadata values
  • services/cloud-agent-next/src/container-usage-context.ts - 1 issue (stale snapshot caused by these changed lines)
  • services/cloud-agent-next/src/container-usage.test.ts - no issues; the SandboxSmallContainment 20 000 and reverted SandboxDIND 10 000 expectations match the config
  • services/cloud-agent-next/wrangler.jsonc - no issues; the reworded comment and the two containment disk_mb values now agree with the other two mirrored sources

Fix these issues in Kilo Cloud

Previous review (commit eef1379)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

A stale capacity snapshot in container-usage-context.test.ts (unchanged by this PR) will fail the cloud-agent-next unit CI job now that SANDBOX_CAPACITIES disks were raised, plus a misleading accuracy nit in the new wrangler comment.

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
services/cloud-agent-next/src/container-usage-context.ts 58 container-usage-context.test.ts:328-337 still snapshots the old 10_000 / 8_000 disks, so pnpm --filter cloud-agent-next test fails in CI. Update the snapshot alongside this change.

SUGGESTION

File Line Issue
services/cloud-agent-next/wrangler.jsonc 184 "Every production container class requests the platform maximum 20 GB disk" is inaccurate: SandboxContainers standard-3 remains 16_000 MB. Scope the comment to the tiered legacy classes.
Files Reviewed (4 files)
  • apps/web/src/lib/cloudflare/container-capacity.ts - no issues; values match the parity test's diskMB * 1_000_000 math
  • services/cloud-agent-next/src/container-usage-context.ts - 1 issue (stale snapshot caused by changed lines)
  • services/cloud-agent-next/src/container-usage.test.ts - no issues; updated expectations match SandboxSmall/SandboxDIND (vcpu 2, 6144 MiB)
  • services/cloud-agent-next/wrangler.jsonc - 1 issue (comment accuracy); all seven production instance_type.disk_mb values now 20 000, dev overrides intentionally unchanged

Context checked and found consistent: container-capacity-parity.test.ts, render-e2e-worker-config.test.ts, container-context, apps/web capacity consumers, and the PR's stated 30 TB concurrent-disk ceiling caveat.

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 52.7K · Output: 6.6K · Cached: 343.6K

Review guidance: REVIEW.md from base branch main

…asses

Narrow the 20 GB disk change to the classes that actually carry live
instances: SandboxSmallContainment (10 -> 20 GB) and
SandboxCodeReviewContainment (8 -> 20 GB). SandboxContainment was
already at 20 GB.

Sandbox, SandboxSmall, SandboxDIND, and the non-containment
SandboxCodeReview have no live instances (every non-contained session
runs in Sandbox, and credential containment routes traffic to the
containment classes), so they keep their lower tiers.
@eshurakov eshurakov changed the title feat(cloud-agent-next): raise sandbox container disk to 20 GB feat(cloud-agent-next): raise disk to 20 GB for live containment sandbox classes Oct 19, 2026
…parity test

Remove tests that restate container configuration values, so changing a
sandbox capacity or SKU no longer requires editing test expectations:

- container-capacity-parity.test.ts (deleted)
- SKU, legacy capacity, containers capacity, and Vercel capacity/identity
  snapshots in container-usage-context.test.ts

Behavior tests are unchanged: rejection of unsupported instance sizes,
class classification, capacity-routing dispatch, and attribution. The
routing test now compares against the exported capacity tables instead of
duplicating their values.

The three sources (wrangler.jsonc, SANDBOX_CAPACITIES, and the web
container-capacity table) are now kept in sync manually; the comments in
the two code files say so.
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.

2 participants