validate and select configured harness adapters
This commit is contained in:
+18
-1
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user