Repository navigation
🐛 watchdog: don't raise CredentialMissing for login chrome inside boot grace - #17576
Conversation
…t grace Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Evidence bundle `#175762748701` sha256:f816dfb6d10594e55fb373f3e333ee2a8393ffc635196b4ba41fce7d09b18766 — download from the dashboard or `hivectl review evidence #17576`. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Read the diff against the tree at a66c604, plus the two callers that feed it. Looks correct to me.
Why the fix is sound:
src/crux/agent/authprobe.go:262-264— forclaude,AgentAuthStatereturns(available=false, known=true)only via theneedsLoginbranch; the file-probe path at:285-300deliberately returnsknown=false. So on a claude agent,obs.AuthKnown && !obs.AuthAvailableis literally the same pane sighting the classifier is withholding.src/crux/watchdog/classify.go:221-243— withSessionExists && ShowsLoginPrompt,Classifyreturns eitherClassUnknown(booting) orClassAuthRequired. SologinChromeSuppressed := obs.ShowsLoginPrompt && cls.Class != ClassAuthRequiredatreconciler.go:799is exactly "login chrome inside boot grace" — no wider.- Suppression is a delay, not a loss: once
BootGraceelapses the same pane goesClassAuthRequired→PaneShowsLogin→ConditionFalse→ alert (reconciler.go:819-822,:854-861). For copilot, whose probe can be genuinely known-absent from a missing file, the alert therefore still fires on the first post-grace tick. - The new test fails without the change:
StartedAt: clock.Now()puts it insideDefaultBootGrace, so without the guard the branch setsConditionFalseandAddSystemAlert(authAlertID("a1")).
Helpers used by the test (fastSettings, loginPane, fakeAlerter.has, newTestReconciler) all exist in the package; gofmt -l is clean. Changelog fragment present.
Nothing blocking from my side.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the tree at ec7db9d, not just the diff. Looks correct to me.
Why the guard is safe: Classify (src/crux/watchdog/classify.go:215-248) only withholds ClassAuthRequired for a pane with ShowsLoginPrompt when booting is true — the !SessionExists branch returns before the login check, so loginChromeSuppressed (reconciler.go:799) is true in exactly one reachable state: login chrome inside boot grace. Once grace elapses the classifier flips to ClassAuthRequired and the PaneShowsLogin branch above pages as before, so nothing is permanently silenced.
One observation, not a defect: the comment at reconciler.go:795-798 and the changelog fragment say "for claude", but AgentAuthState rule (3) (src/crux/agent/authprobe.go:263-265) returns (false, true) from needsLogin for every interactive backend before reaching the file probe, so the same false CredentialMissing page fired for copilot inside grace too, and this PR fixes it there as well. That is the right behaviour (the fleet wires needsLogin straight from agent.NeedsLogin, watchdog_fleet.go:124-130); only the prose is narrower than the fix.
Test TestAuthCredentialMissingHonoursLoginBootGrace exercises the branch that was actually wrong (AuthKnown && !AuthAvailable with StartedAt == now) and would fail without the !loginChromeSuppressed term.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Mutation testing (advisory)No surviving mutants in changed files (or the run hit its time budget before reporting any). Advisory only; this job never blocks the PR (#17349). |
There was a problem hiding this comment.
Read the guard against the tree at 2748701; this looks correct to me.
Mechanism checks out end-to-end. crux/agent/watchdog_fleet.go:130 passes the pane poller's agent.NeedsLogin into AgentAuthState, and rule (3) at crux/agent/authprobe.go:260 returns (available=false, known=true) for that signal before any file probe runs. So whenever the classifier sees login chrome inside boot grace and returns ClassUnknown (crux/watchdog/classify.go:259), the old obs.AuthKnown && !obs.AuthAvailable branch at reconciler.go:823 was raising CredentialMissing from the very same sighting. loginChromeSuppressed closes that gap precisely.
Two notes, neither a defect:
- The fix is broader than the body's "for claude" framing — rule (3) in
AgentAuthStatefires for every interactive backend, so copilot agents inside boot grace were taking the sameCredentialMissingpath, and the guard also covers theApplyLoginStreakdowngrade window (classify.go:327), where the class is likewise notClassAuthRequired. Both are the intended outcome; just noting the changelog line could say "login chrome" rather than "Claude login chrome". - Existing
CredentialMissingassertions (reconciler_test.go:708,refreshable_credential_test.go:85) usereadyObs()/Pane: "❯"withShowsLoginPromptunset, so they are unaffected. The new test fails without the change (class isUnknownunderDefaultBootGrace, probe says known-absent →ConditionFalsebefore the fix).
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Review follow-ups (below
|
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
The classifier withholds ClassAuthRequired for login chrome inside boot grace, but for claude the per-agent probe reports known-absent only from that same pane signal, so reconcileAuth's CredentialMissing branch re-raised the ERROR + alert (and the agent_login_required selfreport) the grace was meant to suppress. Skip that branch when the classifier declined the login sighting.
Closes #17573
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88