feat: manage task process lifetimes and preserve turn history

This commit is contained in:
Ed1s0nZ
2026-09-16 17:52:58 +08:00
parent fd1c13a43d
commit f7882be546
54 changed files with 3650 additions and 330 deletions
+31
View File
@@ -0,0 +1,31 @@
//go:build !linux && !windows
package processguard
import (
"encoding/json"
"fmt"
)
func configurePlatform(o *Options) error {
if o.Mode == "required" || o.CgroupRoot != "" {
return fmt.Errorf("kernel task containment is unavailable on this OS; use a Linux cgroup deployment")
}
return nil
}
func newPlatformGroup(id string, o Options) (Group, error) {
if err := configurePlatform(&o); err != nil {
return nil, err
}
return newUnixGroup()
}
func guardianMain(dec *json.Decoder, enc *json.Encoder) error {
var req watchRequest
if err := dec.Decode(&req); err != nil {
return err
}
if req.Name != "process_group" {
return fmt.Errorf("unsupported guardian")
}
return groupGuardian(dec, enc)
}