From bbb284e3789abca8b6c229a1a1d038a87d843de7 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Fri, 12 Jun 2026 17:50:24 +0200 Subject: [PATCH] fix: derive intent store path from the agent state dir (not LocalAPI.StateDir) --- cmd/felhom-agent/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/felhom-agent/main.go b/cmd/felhom-agent/main.go index 5bb2aa2..7ee2610 100644 --- a/cmd/felhom-agent/main.go +++ b/cmd/felhom-agent/main.go @@ -333,7 +333,11 @@ func runDaemon(cfg config.Config, logger *slog.Logger) int { // state. Gates the watchdog's self-heal re-mount to ENROLLED drives, and the local API records // enroll/eject into it. Open failure → ungated legacy remount (logged) so the daemon still runs. var intentReader storage.IntentReader - intentStore, ierr := storage.OpenIntentStore(filepath.Join(cfg.LocalAPI.StateDir, "drive-intents.json")) + intentStateDir := "/var/lib/felhom-agent" + if cfg.Authz.NonceStorePath != "" { + intentStateDir = filepath.Dir(cfg.Authz.NonceStorePath) // share the agent's durable state dir + } + intentStore, ierr := storage.OpenIntentStore(filepath.Join(intentStateDir, "drive-intents.json")) if ierr != nil { logger.Warn("storage: intent store unavailable — self-heal runs UNGATED (legacy remount-any)", "err", ierr) intentStore = nil