Repository navigation
fix(server): log known forge quota pauses without warning stacks - #24608
juliusmarminge wants to merge 13 commits into
Conversation
…1-quota-pause-logs-20261015
Keeps main's branch-retention discovery tests alongside the reduced quota-pause log regressions, and restores the plain warning in the per-thread settle dispatch catch, which performs no GitHub reads. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… PR summary reads A rate-limited PullRequestProviderError is a known pause even when GitHub omits the reset headers, so the helper now classifies it as a pause and only reports retryAt when the provider error or a typed inner pause carries one. The per-thread discovery catch that consumes saved pull request summary failures now logs through the same helper, so a paused summary read no longer emits a warning stack per thread. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replace the original PR's log tests with the minimum behavioural set: a paused branch lookup and a paused saved pull request read log one Info line without a stack, an unexpected lookup failure keeps its Warn stack, and a rate-limited settlement read without a reset time logs Info and settles nothing. The Info assertions stay red until the implementation moves from Debug to Info. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A known rate-limit pause repeats on every pull request sweep until the reset time, so it now logs a single Info line with the retry time and thread ids instead of a Warn stack. The pretty console logger spreads structured fields over several lines, so the pause line carries its context as text. Unknown failures keep their Warn stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub's GitHubApiRateLimitError and GitCafe's 429 GitCafeApiError reach the pull request sweeps wrapped in SourceControlProviderError before the host pause starts, so they still warned with a stack. Each source control driver now recognizes its own refusal through an optional rateLimitRefusal hook, and the shared failure logger asks the registry instead of naming forge types. A reset time that is not a valid date is left out of the line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bitbucket reports a 429 whose body could not be read as BitbucketResponseBodyReadError. Its own throttle and pull request mapper already treat that as a rate limit, but the driver's rateLimitRefusal hook only matched BitbucketResponseError, so the sweep still warned with a stack. The hook now matches both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR narrowly adjusts background pull-request failure logs so recognized forge quota pauses produce compact Info records while unexpected failures retain warning stacks. Request, retry, discovery, settlement, and stored-data behavior remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Known forge quota refusals in background PR discovery and settlement now log one Info line without a stack. Unknown failures, defects and compound causes retain warning stacks. Pause, retry, backfill and settlement behavior is unchanged.
Fixes #19781. Replaces #19794.
Original description by @aravhawk
Problem
Known GitHub quota pauses in thread PR discovery and automatic settlement emit warning stacks on every sweep, even though quota admission already blocks those reads until reset.
Change
Log recognized typed quota pauses as compact Debug records with thread context and a retry time when known. Typed rate-limit refusals without a retry time still log at Debug; an inner typed cause can supply the timestamp. Unexpected failures, defects and compound causes retain warning stacks. The helper applies to discovery group reads, per-thread saved-PR summary reads, and settlement group reads; the per-thread settlement dispatch catch stays unchanged because it performs no GitHub read.
Quota admission, retry scheduling, settlement eligibility, interruption handling and discovery backfill behavior remain unchanged.
Scope and approval
Fixes #19781, with maintainer approval. Credit to aravhawk for the original contribution. Contributor commits are retained, and current main is integrated by merge.
Verification
Fresh complete independent Claude Opus 5.5 and GPT 6.1 Sol reviews approve 1d98d5a564.
Implementation: Claude Fable 5.1. Minimal tests and independent review: Claude Opus 5.5. Coordination and independent review: GPT 6.1 Sol, through T3 Code.
Takeover
Credit to @aravhawk for the original contribution; the author’s commits are retained. This replacement uses Info and a single text record because the pretty logger spreads structured context over multiple lines.
Forge-owned driver classifiers also cover initial refusals, including Bitbucket 429 body-read failures. Duplicate timestamp tests were replaced with service regressions for previously missed real error types.
Evidence
Before: 76da264a0c. After: bcfa2526f1.
Fixture matrix · Complete paired transcripts and reproduction scripts · Independent audit.
Linux x86_64, Node v26.12.1, real source dev server/workers/pretty logger, fresh temporary homes. APP+STUB fetches loopback 429/502 responses and constructs typed failures; real forge HTTP/admission is bypassed. HARNESS rows call the classifier directly. No live data, real quota exhaustion or browser use.
Paired app records: 18 distinct baseline Warn records become 14 single-line Info and 4 unknown Warn records. Repeated sweeps are also retained. Paired classifier records: 25 cases pass. State proof: nine equal thread payloads excluding timestamps, four saved references retained, no settlement or provider runs.
What else changed: expected log level and format only. No UI change. All 19 required matrix rows are covered.
Verification log
Fixes #19781