An open-source, faster Devin alternative
TypeScript
fix: clean up exec sessions on sandbox hibernate/kill to prevent memory leak
motatoes635ec9589bb4
diff --git a/cmd/worker/main.go b/cmd/worker/main.goindex c2d62609..b819bc2c 100644--- a/cmd/worker/main.go+++ b/cmd/worker/main.go@@ -284,6 +284,7 @@ func main() {OnHibernate: func(sandboxID string, result *sandbox.HibernateResult) {log.Printf("opensandbox-worker: sandbox %s auto-hibernated (key=%s, size=%d bytes)",sandboxID, result.HibernationKey, result.SizeBytes)+ execMgr.RemoveSessions(sandboxID)if store != nil {// Create hibernation record so wake-on-request can find itsession, err := store.GetSandboxSession(context.Background(), sandboxID)@@ -296,6 +297,7 @@ func main() {},OnKill: func(sandboxID string) {log.Printf("opensandbox-worker: sandbox %s killed on timeout", sandboxID)+ execMgr.RemoveSessions(sandboxID)if store != nil {_ = store.UpdateSandboxSessionStatus(context.Background(), sandboxID, "stopped", nil)}