From a66c6042c6817f235dd2399ca9a95fd45079ed37 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Tue, 10 Nov 2026 13:43:03 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20watchdog:=20don't=20raise=20Cred?= =?UTF-8?q?entialMissing=20for=20login=20chrome=20inside=20boot=20grace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- ...-watchdog-credential-missing-boot-grace.md | 1 + src/crux/watchdog/reconciler.go | 8 +++++- .../watchdog/refreshable_credential_test.go | 26 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fixed-watchdog-credential-missing-boot-grace.md diff --git a/changelog.d/fixed-watchdog-credential-missing-boot-grace.md b/changelog.d/fixed-watchdog-credential-missing-boot-grace.md new file mode 100644 index 0000000000..dbe21a54d1 --- /dev/null +++ b/changelog.d/fixed-watchdog-credential-missing-boot-grace.md @@ -0,0 +1 @@ +- Watchdog no longer raises a "CredentialMissing" credential-failure alert (and fleet self-report) for Claude login chrome seen inside the boot grace window (#17573). diff --git a/src/crux/watchdog/reconciler.go b/src/crux/watchdog/reconciler.go index 22ac20caf5..cb63887c98 100644 --- a/src/crux/watchdog/reconciler.go +++ b/src/crux/watchdog/reconciler.go @@ -792,6 +792,12 @@ func (r *Reconciler) reconcileAuth(ctx context.Context, name string, obs Observa // standing operator alert must be cleared. healable := cls.Class == ClassAuthRequired && obs.CredentialProven + // The classifier withheld ClassAuthRequired for login chrome (boot grace). + // For claude the per-agent probe only answers known-absent from that same + // pane signal (AgentAuthState), so CredentialMissing would re-page the + // very sighting the classifier just declined to act on. + loginChromeSuppressed := obs.ShowsLoginPrompt && cls.Class != ClassAuthRequired + if healable { // A login screen over a credential that demonstrably still works is // the token-restart heal's case, not an operator's — the same division @@ -814,7 +820,7 @@ func (r *Reconciler) reconcileAuth(ctx context.Context, name string, obs Observa status = ConditionFalse reason = "PaneShowsLogin" message = cls.Reason - } else if obs.AuthKnown && !obs.AuthAvailable { + } else if obs.AuthKnown && !obs.AuthAvailable && !loginChromeSuppressed { // The manager's owner-aware per-agent credential probe (#4619/#4641) // says the credential file is definitively absent for an agent whose // backend requires interactive auth. diff --git a/src/crux/watchdog/refreshable_credential_test.go b/src/crux/watchdog/refreshable_credential_test.go index 607ac0bb0e..ab2fa67e4f 100644 --- a/src/crux/watchdog/refreshable_credential_test.go +++ b/src/crux/watchdog/refreshable_credential_test.go @@ -188,3 +188,29 @@ func TestAuthHealableClearsAStandingAlert(t *testing.T) { t.Fatal("alert is sticky: it must clear once the credential is usable again, not wait for the pane to stop showing login chrome") } } + +// TestAuthCredentialMissingHonoursLoginBootGrace: the per-agent probe reports +// known-absent for claude only because the pane showed login chrome. Inside +// boot grace the classifier declines that sighting, so the credential-missing +// branch must not raise the alert it was declining (#17573). +func TestAuthCredentialMissingHonoursLoginBootGrace(t *testing.T) { + clock := newFakeClock() + fleet := newFakeFleet("a1") + fleet.setObs("a1", Observation{ + Backend: "claude", SessionExists: true, + Pane: loginPane, ShowsLoginPrompt: true, + StartedAt: clock.Now(), + AuthKnown: true, AuthAvailable: false, + }) + alerter := newFakeAlerter() + r := newTestReconciler(t, fastSettings(), fleet, alerter, clock) + r.Tick(context.Background()) + + auth, _ := FindCondition(r.Conditions("a1"), ConditionAuthenticated) + if auth.Status == ConditionFalse { + t.Fatalf("Authenticated = %+v, want not False inside boot grace", auth) + } + if alerter.has(authAlertID("a1")) { + t.Fatal("paged an operator for login chrome inside boot grace") + } +}