|
| 1 | +/** |
| 2 | + * vCPU and RAM for the Pi sandbox, shared by both provider builds and by sandbox |
| 3 | + * pricing. The two providers had already drifted here. Daytona asked for 4 CPU / 8 GB |
| 4 | + * while the E2B template asked for nothing and inherited its base default of |
| 5 | + * 2 vCPU / 512 MB — a 16x memory gap between the provider Pi normally runs on and |
| 6 | + * the one it fails over to, which would surface as the agent being killed on E2B |
| 7 | + * for work that succeeded on Daytona. |
| 8 | + * |
| 9 | + * 512 MB is the real problem: the Pi CLI is a Node process holding an LLM |
| 10 | + * context, running beside a `git clone` of the user's repository, and Node has no |
| 11 | + * graceful behaviour at that ceiling — it is OOM-killed, which reaches the user |
| 12 | + * as an opaque agent failure rather than a diagnosable one. |
| 13 | + * |
| 14 | + * Both numbers are at E2B's Professional maximum (8 vCPU / 8192 MB per build, |
| 15 | + * 1 vCPU / 512 MB minimum). Sizing is per-second billed against allocated |
| 16 | + * resources rather than used ones, so this costs roughly 3x the previous E2B |
| 17 | + * default per sandbox-second. On the compute-bound phases that is close to |
| 18 | + * neutral — the work finishes proportionally sooner — but Babysit deliberately |
| 19 | + * idles between review polls, and idle seconds bill at the same rate. Lower |
| 20 | + * {@link PI_SANDBOX_CPU_COUNT} first if that idle time proves dominant: vCPU is |
| 21 | + * ~3x the hourly rate of a GB of RAM, and RAM is the dimension that prevents |
| 22 | + * hard failures. |
| 23 | + */ |
| 24 | +export const PI_SANDBOX_CPU_COUNT = 4 |
| 25 | + |
| 26 | +/** Kept in GB and MB because Daytona takes GB and E2B takes MB. */ |
| 27 | +export const PI_SANDBOX_MEMORY_GB = 8 |
| 28 | +export const PI_SANDBOX_MEMORY_MB = PI_SANDBOX_MEMORY_GB * 1024 |
| 29 | + |
| 30 | +/** |
| 31 | + * Daytona disk for the Pi sandbox. 10 GB is a hard per-sandbox cap there: the API rejects anything |
| 32 | + * larger regardless of plan tier, and raising it requires contacting Daytona. E2B allows 20 GB, so |
| 33 | + * this bounds how large a repository Pi can clone on the failover provider, and it is the one |
| 34 | + * dimension where the two images legitimately differ. |
| 35 | + */ |
| 36 | +export const PI_DAYTONA_DISK_GB = 10 |
0 commit comments