Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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).
8 changes: 7 additions & 1 deletion src/crux/watchdog/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
26 changes: 26 additions & 0 deletions src/crux/watchdog/refreshable_credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Loading