fix(usage-queue): warn each pane on cred failure, not just the first - #233
Merged
Conversation
The credential-failure warning used a single global boolean, so only the first armed pane was warned when usage became unreadable. A pane armed afterward, while creds stayed broken, was never told its queued auto-send could never fire — a silent failure of the exact contract that warning enforces. Move the latch to a per-pane authWarned flag: warn any armed pane not yet warned (including ones armed after an earlier warning), and reset each pane's flag when a real usage signal returns. Adds a regression test for the arm-after-break case. Addresses the unresolved review thread on #232. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UpGRD3fxgWmCKyp9nZtrQs
aterrylu
enabled auto-merge (squash)
June 20, 2026 20:16
nox-0x
approved these changes
Jun 20, 2026
nox-0x
left a comment
Collaborator
There was a problem hiding this comment.
Approving — clean targeted fix for the per-pane vs. global auth-warning latch flagged on #232, with a regression test that exercises the exact failure mode (pane armed after first warning, while creds stayed broken) and the existing 'warn each pane once' and 're-warn on recovery' contracts still hold. Reset loop and arm-time initialization are both in the right place; nothing else to flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #232. A review thread on that PR flagged a real bug in the usage-queue's credential-failure warning:
authFailureNotifiedwas a single global boolean, so the "warn each armed pane once" intent was actually implemented as "warn at most once across all panes."Concretely:
unauthorized→ A is warned,authFailureNotified = true.authFailureNotifiedalready true → B is never warned.B now has a queued auto-send that can never fire and the user has no idea — a silent failure of the exact contract that warning exists to enforce.
Fix
Move the latch from a single global boolean to a per-pane
authWarnedflag onArmedEntry:Testing
warns a pane armed AFTER creds break, while they stay broken— arms one pane, warns it, then arms a second pane while still broken and asserts it's also warned (and the first isn't re-warned).warns each armed pane once) still passes — no re-warn spam, fires both on recovery.Note
This PR's base branch (
main) now requires conversation resolution before merging (newly enabled), so a future unresolved review thread can't slip through to merge the way the original did.🤖 Generated with Claude Code
https://claude.ai/code/session_01UpGRD3fxgWmCKyp9nZtrQs