Repository navigation
fix(router): fall back when public reads are throttled - #1054
giodl73-repo merged 2 commits into
Conversation
Retry public OpenClaw reads once with the target GitHub App token when the public-read installation is rate limited. Explicit credentials, mutations, request bodies, and non-GitHub hosts keep their existing credential boundaries. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3cdcdb00-ade8-4e61-85a7-8151b35f216a
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 12:37 AM ET / 04:37 UTC. ClawSweeper reviewWhat this changesThe PR retries an eligible throttled public OpenClaw read with the target App credential once, with tests for repeated throttles and credential boundaries. Merge readinessKeep open: current main turns an eligible public-read throttle into a rate-limit error, while this PR adds a one-per-App-token recovery path and addresses the prior App-quota finding. Priority: P1 Review scores
Verification
How this fits togetherThe repair comment router reads public OpenClaw issue and PR state before dispatching review work. Public reads normally use a lower-privilege token, while privileged dispatches and mutations use the ClawSweeper App credential. flowchart LR
A[Router read request] --> B[Eligible public-read check]
B --> C[Public GitHub credential]
C --> D{Throttled?}
D -->|No| E[Read result]
D -->|Yes, first time| F[Bounded App-token fallback]
F --> G[Dispatch decision]
D -->|Later throttle| H[Fail closed and defer]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the bounded recovery policy once current-head checks complete, retaining the one-per-App-token circuit breaker and the explicit credential/mutation exclusions. Do we have a high-confidence way to reproduce the issue? Yes. The PR records a pre-fix router Action failing on a public-installation rate limit and a current-head Action succeeding through the same throttled condition. Is this the best way to solve the issue? Yes. A single explicitly eligible fallback with a shared claim guard preserves the existing fail-closed behavior for further throttles and all non-read boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2eb1787e0d18. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Allow at most one public-read recovery for each target App credential in a process. Repeated public throttles fail closed while later privileged mutations retain their configured App-token path. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3cdcdb00-ade8-4e61-85a7-8151b35f216a
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: accept the bounded availability tradeoff. One eligible public-read throttle may consume one App-backed read per target credential and process; later public throttles fail closed, and privileged mutations retain their configured App-token path. |
Summary - retry public OpenClaw read-only requests once with the target GitHub App token when the public-read installation is rate limited - preserve explicit credential, mutation, request-body, and non-GitHub-host boundaries - keep fail-closed
GitHubRateLimitErrorbehavior when the App credential is also throttled ## Validation -tsc -p tsconfig.repair.json-node --test test/repair/github-cli.test.ts-node --test test/repair/comment-router-action-ledger.test.ts- focused oxlint and oxfmt checks ## Live behavior proof - Before the fix, targeted router run31146506671failed withGitHubRateLimitErrorwhile readingopenclaw/openclaw#115962through the public-read installation. - At the PR head, targeted router run31147295076completed successfully and durably dispatched the pending exact-head re-review command foropenclaw/openclaw#115962(router-cad155ddf31271d5). - The immediate default-branch downstream worker run31147323386failed eleven seconds later with the same installation-level HTTP 403. This confirms the public installation remained throttled during the successful PR-head router run; quota recovery did not mask the result. - CI's router credential-boundary suite confirms mutations and explicit credentials remain on their configured token paths. If the fallback App credential is also throttled, the helper still raisesGitHubRateLimitErrorimmediately.Bounded escalation policy
The fallback budget is process-wide and keyed by the target App credential: at most one eligible throttled public read can escalate during a router run. Every later public throttle fails closed with
GitHubRateLimitError. The regression test now covers a successful sync fallback, a repeated throttled read failing closed, a successful async fallback under a separate credential boundary, and a subsequent privileged mutation retaining the App-token path.