Repository navigation
feat(cloud-agent-next): add Vercel billing identity and settlement producer scaffolding - #6797
Conversation
…oducer scaffolding Chunk A of the Vercel sandbox billing work. Inert: no Durable Object constructs the new modules yet. - add Vercel small/large SKUs, classes, capacities, billing identity and isolated-small allocation acceptance - omit disk_mb metadata when a capacity has no disk - add the billingDueAt control-alarm anchor (null preserves composition) - add the lifecycle pinMeasurementCursor/openIntervalBeforeCreate entry points with one internal pin implementation - add the durable per-callback billing schedule table and the Vercel settlement producer (prepare/deliver/close)
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe branch was rebased (the previously reviewed SHA is not an ancestor), so I re-reviewed the full 11-file PR diff against current HEAD: the Vercel billing identity/capacity wiring, the Files Reviewed (11 files)
Previous Review Summary (commit 624045b)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 624045b)Status: No Issues Found | Recommendation: Merge Files Reviewed (11 files)
Verified the Vercel billing identity/capacity wiring, the Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
624045b to
8d81393
Compare
Summary
First chunk of a two-PR stack that lets Vercel sandbox sessions be billed the same way as the
Cloudflare containers runtime: wall-clock seconds metered through the shared
@kilocode/container-usagemeter while the sandbox is alive.This PR is inert infrastructure plus the producer module. Nothing in the Durable Object calls or
constructs the new pieces, so it is safe to merge on its own and cannot change live behaviour.
What's included
container-usage-context.ts—SandboxVercelSmall/SandboxVercelLarge, their SKUs,VERCEL_BILLING_CAPACITIES(2 vCPU/4096 MiB, 4 vCPU/8192 MiB, no disk),vercelBillingIdentity,capacity lookup, the
isolated-smallarm ofassertSandboxBillingAllocation, and exclusion of theVercel classes from
LegacySandboxClassName.SANDBOX_CAPACITIESandCONTAINERS_BILLING_CAPACITIESare unchanged.control-alarm.ts—billingDueAtcomposed into the single control alarm.nullpreserves theexisting composition exactly; this file remains the only
setAlarm/deleteAlarmcaller.billing-schedule.ts(new) — durable per-callback schedule table with load-before-snapshot,"not loaded" distinct from "empty",
retryNotBefore, and a dirty-bit compose callback. No alarmcalls.
metered-billing-lifecycle.ts— omitdisk_mbwhen a capacity has no disk; addpinAssumeHeld,public
pinMeasurementCursor, andopenIntervalBeforeCreate. Containers do not call these andtheir first-schedule stamp is unchanged.
vercel-billing.ts(new) —prepareSettlement/deliverSettlement; pin, zero segment, settlementend from stored
createdAt/terminal time (neverDate.now()); settlement delivery routes throughbillingHeartbeatTickso stop retry and the 60-minute abandon apply.SandboxControl.ts— passbillingDueAt: nullso the new argument compiles.Verification
vitest runon the chunk files: 6 files, 130 passed.pnpm lint: 0 warnings, 0 errors.pnpm typecheck: exit 0.Notes
cloud_billing_skurowscloud-agent-vercel-small-2026-09and
cloud-agent-vercel-large-2026-09(unitsecond, positive rate,accepts_new_usage = true).