Skip to content

🐛 watchdog: don't raise CredentialMissing for login chrome inside boot grace - #17576

Merged
hivecommons-hive[bot] merged 3 commits into
v6from
scanner/fix-17573
Nov 10, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v6from
scanner/fix-17573

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

…t grace

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 10, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 10, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— 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`.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 10, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — for claude, AgentAuthState returns (available=false, known=true) only via the needsLogin branch; the file-probe path at :285-300 deliberately returns known=false. So on a claude agent, obs.AuthKnown && !obs.AuthAvailable is literally the same pane sighting the classifier is withholding.
  • src/crux/watchdog/classify.go:221-243 — with SessionExists && ShowsLoginPrompt, Classify returns either ClassUnknown (booting) or ClassAuthRequired. So loginChromeSuppressed := obs.ShowsLoginPrompt && cls.Class != ClassAuthRequired at reconciler.go:799 is exactly "login chrome inside boot grace" — no wider.
  • Suppression is a delay, not a loss: once BootGrace elapses the same pane goes ClassAuthRequired → 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 inside DefaultBootGrace, so without the guard the branch sets ConditionFalse and AddSystemAlert(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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

Copy link
Copy Markdown
Contributor

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).

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AgentAuthState fires for every interactive backend, so copilot agents inside boot grace were taking the same CredentialMissing path, and the guard also covers the ApplyLoginStreak downgrade window (classify.go:327), where the class is likewise not ClassAuthRequired. Both are the intended outcome; just noting the changelog line could say "login chrome" rather than "Claude login chrome".
  • Existing CredentialMissing assertions (reconciler_test.go:708, refreshable_credential_test.go:85) use readyObs()/Pane: "❯" with ShowsLoginPrompt unset, so they are unaffected. The new test fails without the change (class is Unknown under DefaultBootGrace, probe says known-absent → ConditionFalse before the fix).

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Review follow-ups (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line are listed here instead of as issues, one comment per PR, updated in place. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 info style — loginChromeSuppressed comment names only boot grace; after the v6 merge it also covers the login-streak downgrade (src/crux/watchdog/reconciler.go:795): The PR's comment at reconciler.go:795-798 says 'The classifier withheld ClassAuthRequired for login chrome (boot grace)'. Since merge commit 2748701, cls comes from classifyLocked (reconciler.go:571…

@hivecommons-hive
hivecommons-hive Bot merged commit 7c6876d into v6 Nov 10, 2026
84 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-17573 branch November 10, 2026 19:12
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[selfreport] agent_login_required: watchdog: agent credential failure

0 participants