validate and select configured harness adapters

This commit is contained in:
kami
2026-07-26 20:25:17 +04:00
parent 4e05e4df7b
commit 98725c28c5
3 changed files with 22 additions and 1 deletions
+18 -1
View File
@@ -45,7 +45,24 @@ func main() {
continue
}
client := herdr.New(h.Address)
adapters[h.ID] = herdr.Codex(client, 200000)
protocol := h.Protocol
if protocol == "" {
protocol = os.Getenv("ORCHESTRA_HERDR_PROTOCOL")
}
if err := client.CheckProtocol(context.Background(), protocol); err != nil {
log.Printf("herdr %s unavailable: %v", h.ID, err)
continue
}
switch h.Harness {
case "claude":
adapters[h.ID] = herdr.Claude(client, 200000)
case "opencode":
adapters[h.ID] = herdr.OpenCode(client, 200000)
case "codex", "":
adapters[h.ID] = herdr.Codex(client, 200000)
default:
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}}
rt.OnLease = func(e domain.Event) error { return coordinator.Start(context.Background(), e) }