Repository navigation
test(claude): cover the renewal-then-read-back path end to end - #169
Merged
Merged
Conversation
The self-healing path had no coverage at all: an expired-but-renewable login was the one case the reader is supposed to recover from on its own, and nothing asserted that a renewal which actually lands is used. This drives the real sequence through LocalQuotaReader — expired record, one renewal run, Claude Code's rewritten login read back on the same refresh — and asserts the row reports the renewed token's quota with no issue and no consent prompt. Uses a locked one-way gate for the flag both closures touch, since they run on different tasks. Suite is now 332 tests, 3 skipped, 0 failures.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Follow-up to #168 (which merged as
c39639c).The renewal-then-read-back path had no coverage at all. An expired-but-renewable login is the one case
LocalQuotaReaderis supposed to recover from on its own — it asks Claude Code to renew its own login, then reads the result back on the same refresh — and nothing asserted that a renewal which actually lands is used.This drives the real sequence through
LocalQuotaReader: expired record → one renewal run → Claude Code's rewritten login read back → quota published from the renewed token, with no issue and no consent prompt. The injected credential closure assertsBearer renewed, so a reader that quietly sent the stale token would fail rather than pass quietly.Uses a locked one-way gate for the flag the renewal closure and the credential closure both touch, since they run on different tasks.
Scope: test-only, one file,
+55. The production fix in #168 is unchanged.swift teston main + this commit: 331 passed, 3 skipped, 0 failures.Note for reviewers: I checked this test against a reverted gate — it does not fail without the #168 fix, because the fix lives in
ClaudeCredentialSource.resolveSilentlyand this test injects past it. It is not a regression test for #168. The real regression coverage for that bug is the twoClaudeConsentTestscases that shipped in #168. This test covers a separate, previously-untested path.