persist and reconcile runtime sessions

This commit is contained in:
kami
2026-07-26 20:28:41 +04:00
parent afac166989
commit ad32f29cd5
3 changed files with 67 additions and 2 deletions
+2 -1
View File
@@ -17,6 +17,7 @@ import (
"orchestra/internal/router"
"orchestra/internal/store"
"os"
"path/filepath"
"strconv"
"strings"
"time"
@@ -65,7 +66,7 @@ func main() {
log.Printf("herdr %s has unsupported harness %q", h.ID, h.Harness)
}
}
coordinator := &orchestrator.Coordinator{Store: s, Worktrees: orchestrator.GitWorktrees{Root: root, Repo: repo}, Adapters: orchestrator.AdapterFactory{Herdrs: adapters}}
coordinator := &orchestrator.Coordinator{Store: s, StatePath: filepath.Join(dir, "runtime-sessions.json"), Worktrees: orchestrator.GitWorktrees{Root: root, Repo: repo}, Adapters: orchestrator.AdapterFactory{Herdrs: adapters}}
rt.OnLease = func(e domain.Event) error { return coordinator.Start(context.Background(), e) }
hard := 0.75
if v, parseErr := strconv.ParseFloat(os.Getenv("ORCHESTRA_OCCUPANCY_HARD"), 64); parseErr == nil && v > 0 && v < 1 {