diff --git a/changelog.d/fixed-16080-omp-home-probe-log-level.md b/changelog.d/fixed-16080-omp-home-probe-log-level.md new file mode 100644 index 0000000000..19da69d472 --- /dev/null +++ b/changelog.d/fixed-16080-omp-home-probe-log-level.md @@ -0,0 +1 @@ +- An omp agent HOME without a sign-in no longer files a repeated fleet defect: both the per-HOME "omp model discovery found no models for this HOME" line and the all-homes-failed "omp model discovery unavailable, serving static fallback" line are logged at Info instead of Warn, matching the goose/agy/claude backends. A HOME with no sign-in contributes nothing by design, and the degraded-discovery transition is already audited once by the discovery tracker ([#16080](https://github.com/hivecommons/hive/issues/16080)). diff --git a/src/pkg/dashboard/cli_models_omp.go b/src/pkg/dashboard/cli_models_omp.go index 493a07063c..f89dd75f4e 100644 --- a/src/pkg/dashboard/cli_models_omp.go +++ b/src/pkg/dashboard/cli_models_omp.go @@ -84,7 +84,7 @@ func (s *Server) discoverOmpModels() cliModelResult { } lastErr = err if s.logger != nil { - s.logger.Warn("omp model discovery found no models for this HOME", "home", home, "err", err.Error()) + s.logger.Info("omp model discovery found no models for this HOME", "home", home, "err", err.Error()) } continue } @@ -97,7 +97,7 @@ func (s *Server) discoverOmpModels() cliModelResult { } if len(models) == 0 { if s.logger != nil { - s.logger.Warn("omp model discovery unavailable, serving static fallback", "homes", homes, "err", fmt.Sprint(lastErr)) + s.logger.Info("omp model discovery unavailable, serving static fallback", "homes", homes, "err", fmt.Sprint(lastErr)) } return cliModelResult{fallback: true, reasoningEfforts: cloneEffortMap(ompStaticReasoningEfforts)} } diff --git a/src/pkg/dashboard/cli_models_omp_test.go b/src/pkg/dashboard/cli_models_omp_test.go index 60f8fecf6d..76e9bead9d 100644 --- a/src/pkg/dashboard/cli_models_omp_test.go +++ b/src/pkg/dashboard/cli_models_omp_test.go @@ -1,6 +1,12 @@ package dashboard -import "testing" +import ( + "bytes" + "errors" + "log/slog" + "strings" + "testing" +) func TestOmpProbeRunsUnderGivenHome(t *testing.T) { t.Setenv("HOME", "/data/home/agents/x") @@ -30,3 +36,43 @@ func TestOmpStaticEffortsMatchCatalog(t *testing.T) { t.Errorf("gemini-3.7-flash efforts = %v", got) } } + +func TestOmpHomeWithoutSignInIsNotAWarning(t *testing.T) { + t.Setenv("HOME", "/data/home/agents/unsigned") + orig := runOmpModelsProbe + t.Cleanup(func() { runOmpModelsProbe = orig }) + runOmpModelsProbe = func(home string) ([]string, map[string][]string, error) { + return nil, nil, errors.New("omp models failed: exit status 1") + } + var buf bytes.Buffer + s := newTestServer() + s.logger = slog.New(slog.NewTextHandler(&buf, &slog.HandlerOptions{Level: slog.LevelDebug})) + r := s.discoverOmpModels() + if !r.fallback { + t.Fatalf("expected static fallback when no HOME has a sign-in: %+v", r) + } + var sawMiss, sawFallback bool + for _, line := range strings.Split(buf.String(), "\n") { + if strings.Contains(line, "found no models for this HOME") { + sawMiss = true + if strings.Contains(line, "level=WARN") { + t.Fatalf("per-HOME miss must not log at WARN (fleet reporter files it as a defect): %s", line) + } + } + if strings.Contains(line, "omp model discovery unavailable") { + sawFallback = true + if strings.Contains(line, "level=WARN") { + t.Fatalf("all-homes-failed fallback must not log at WARN (fleet reporter files it as a defect): %s", line) + } + } + } + if !sawMiss { + t.Fatal("per-HOME miss should still be logged below WARN") + } + if !sawFallback { + t.Fatal("all-homes-failed fallback should still be logged below WARN") + } + if strings.Contains(buf.String(), "level=WARN") { + t.Fatalf("discoverOmpModels must not emit any WARN for a HOME without a sign-in: %s", buf.String()) + } +}