feat(sandbox): handle destroyed sandbox, add pause/resume, keep-alive#4437
feat(sandbox): handle destroyed sandbox, add pause/resume, keep-alive#4437NathanFlurry wants to merge 3 commits intomainfrom
Conversation
|
🚅 Deployed to the rivet-pr-4437 environment in rivet-frontend
|
|
PR Review: feat(sandbox): handle destroyed sandbox, add pause/resume, keep-alive Good overall implementation. The resilience features are well-scoped and the code is readable. A few issues to address: Bug: onSandboxExpired callback not awaited Bug: destroySandbox proxy does not update actor state Bug: Potential state inconsistency in pause action Minor: Captured sandboxId in syncKeepAlive is inconsistently used Minor: Double reconnect in resume Test coverage gaps |
Description
Upgrades
sandbox-agentto0.4.1-rc.1and adds resilience features to the sandbox actor:SandboxDestroyedError: When the provider reports the sandbox has expired (e.g. E2B timeout),ensureAgent()now catchesSandboxDestroyedErrorand either marks the sandbox as destroyed (onSandboxExpired: "destroy") or transparently provisions a new one (onSandboxExpired: "recreate"). Broadcasts events to connected clients in both cases.pauseandresumeactor actions delegate to the provider'spause()andreconnect()hooks for user-initiated sandbox lifecycle control.keepAliveIntervalMsoption periodically callsprovider.reconnect()while sessions are subscribed, preventing sandbox timeout during active use.pauseSandboxandkillSandboxfrom the updated sandbox-agent SDK.onSandboxExpiredcallback,onSandboxExpiredoption ("destroy"/"recreate"),keepAliveIntervalMsoption.Type of change
How Has This Been Tested?
build:publishbuild succeedsChecklist: