fix(queue): debounce PR-write permission refreshes - #2514
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 07:18:08 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2514 +/- ##
==========================================
+ Coverage 95.93% 95.95% +0.01%
==========================================
Files 225 226 +1
Lines 25336 25396 +60
Branches 9217 9237 +20
==========================================
+ Hits 24306 24368 +62
Misses 417 417
+ Partials 613 611 -2
🚀 New features to boost your workflow:
|
Motivation
refreshInstallationHealthForInstallationon any PR-write403, which can be caused by rate limits or operation-specific forbidden errors and creates an availability/cost amplification risk.Description
shouldRefreshInstallationHealthAfterPrWriteFailurethat returns true only for numeric403errors with a permission-looking message and that rejects rate-limit/secondary-limit errors viaisGitHubRateLimitedErrorandgithubErrorStatus.INSTALLATION_HEALTH_REFRESH_COOLDOWN_MS, 5 minutes) with an in-memoryMapto debounce repeated refresh attempts for the same installation.refreshInstallationHealthForInstallationis only invoked when appropriate.test/unit/agent-action-executor.test.tscovering: rate-limit/operation-specific 403s do not refresh, permission-looking 403 still triggers a refresh, cooldown debounces repeated refreshes, and the refresh-failure path remains best-effort.Testing
git diff --checkwhich produced no issues locally. (passed)npm run typecheckwhich completed with no type errors. (passed)npx vitest run test/unit/agent-action-executor.test.tsafter adding the new tests; the suite passed (50 tests passed). (passed)npm run test:ciandnpm audit --audit-level=moderatebut these were blocked in the local environment due to external network/setup issues (actionlintsetup could not reachgithub.laiyagushi.comand the npm audit endpoint returned 403). (blocked)Codex Task