fix(cloud-agent-next): recover leaked sandbox wrappers safely - #3555
Conversation
Code Review SummaryStatus: 1 Issue Remaining (carried forward, intentional by design) | Recommendation: Merge Executive SummaryThis PR introduces a durable physical-wrapper lease FSM to fence sandbox process ownership, routes all stop/discovery through a new Overview
Issue Details (click to expand)RESOLVED (from prior rounds)
WARNING (carried forward — author acknowledged as intentional)
WARNING — When the metadata key is missing but a The PR author has acknowledged this as intentional fail-closed behavior: without metadata the DO cannot reconstruct the provider sandbox to verify physical wrapper absence, so retaining the non- Additional Observations (not blocking)
In
The new implementation always uses
These new error types propagate through Files Reviewed (46 files)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-4.6 · 8,949,567 tokens Review guidance: REVIEW.md from base branch |
|
Addressed the actionable warm-bootstrap progress finding in I did not change the missing-metadata deletion branch. The public delete route short-circuits when session metadata is absent, and the Durable Object cannot reconstruct the provider sandbox or verify physical wrapper absence without that metadata. Retaining a non- |
e2e56e6 to
8e63f2d
Compare
Fence physical wrapper ownership, verify cleanup before reuse or deletion, and reject unsafe capacity recovery paths so shared sandboxes do not retain leaked wrapper processes.
8e63f2d to
a6fe757
Compare
* fix(cloud-agent-next): skip container wake on idle-timeout stops The idle sweep requests a physical wrapper stop only after confirming via DO state that no wrapper runtime or pending work remains. stopWrappers then inspected the container to re-derive that, and listProcesses is a container fetch, so a sleeping container was cold-booted to look for processes that activity expiry had already SIGTERMd. It then idled to the 900s sleepAfter. In 90 minutes of production logs this path was 233 inspections, all absent, none present. Confirm absence from container state instead when the container is stopped. A wrapper is a process and cannot outlive its container, so a stopped container cannot hide a leaked wrapper. Scoped to idle-timeout: every other stop reason still inspects, preserving the leaked wrapper recovery added in #3555. * fix minor observability-duplication
Summary
AgentSandboxseam as the provider boundary for physical discovery, stop, keep-alive, and capacity operations; runtime, supervisor, deletion, interrupt, terminal, and router flows now converge on that lifecycle rather than performing ad-hoc sandbox teardown.Verification