M2: wire planning coach backend into the daemon with graceful fallback
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,10 +5,12 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"antidrift/internal/ai"
|
||||||
"antidrift/internal/evidence"
|
"antidrift/internal/evidence"
|
||||||
"antidrift/internal/session"
|
"antidrift/internal/session"
|
||||||
"antidrift/internal/store"
|
"antidrift/internal/store"
|
||||||
@@ -30,6 +32,16 @@ func main() {
|
|||||||
srv := web.NewServer(ctrl)
|
srv := web.NewServer(ctrl)
|
||||||
srv.Init() // re-arm or expire a restored Active session
|
srv.Init() // re-arm or expire a restored Active session
|
||||||
|
|
||||||
|
// Wire the AI planning coach. Backend selectable via ANTIDRIFT_AI_BACKEND
|
||||||
|
// (claude default, or codex). Misconfiguration degrades to no coach rather
|
||||||
|
// than failing startup — manual planning still works.
|
||||||
|
if backend, err := ai.NewBackend(os.Getenv("ANTIDRIFT_AI_BACKEND")); err != nil {
|
||||||
|
log.Printf("ai coach disabled: %v", err)
|
||||||
|
} else {
|
||||||
|
ctrl.SetCoach(ai.NewService(backend))
|
||||||
|
log.Printf("ai coach: %s backend", backend.Name())
|
||||||
|
}
|
||||||
|
|
||||||
src := evidence.NewSource()
|
src := evidence.NewSource()
|
||||||
go src.Watch(context.Background(), ctrl.RecordWindow)
|
go src.Watch(context.Background(), ctrl.RecordWindow)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user