Repository navigation
Conversation
… usage reset Rate-limited Anthropic OAuth profiles got the generic 30s to 5min backoff while Codex profiles cool down until the provider's exact reset time. The OAuth usage endpoint already reports window resets for the /usage display; probe it on rate-limit failures and block until the soonest exhausted window's reset, mirroring the WHAM flow with a claude_usage block source. Signed-off-by: Yufeng He <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed August 26, 2026, 10:43 PM ET / August 27, 2026, 02:43 UTC. ClawSweeper reviewWhat this changesThe PR adds an Anthropic OAuth usage probe that tries to cool a rate-limited auth profile until the earliest reported usage-window reset. Merge readiness⛔ Blocked before merge - 13 items remain Keep this draft open: current main still limits reset-time probes to OpenAI, but this branch misses the canonical Claude CLI profile, widens model-specific limits, and bypasses the provider-owned request path. Priority: P2 Review scores
Verification
How this fits togetherAuth profiles record provider failures and decide which credential can be retried next. Anthropic’s provider plugin already fetches and normalizes usage windows for status reporting; this change attempts to feed those windows into failover cooldowns. flowchart LR
A[Provider request fails] --> B[Auth profile failure record]
B --> C[Provider usage reader]
C --> D[Cooldown scope decision]
D --> E[Profile selection and failover]
Decision needed
Why: The repair needs a durable plugin API and credential/transport ownership boundary; choosing and publishing that contract is maintainer product and compatibility direction. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +62, Tests +101. Total +163 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Define a provider-owned, profile-aware cooldown result that retains the affected model when applicable, then route Claude CLI auth through that owner and prove reset-to-recovery with a redacted real OAuth run. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main only probes OpenAI, and the PR predicate excludes the canonical claude-cli profile. No real OAuth rate-limit-to-reset run was provided or executed. Is this the best way to solve the issue? No: the branch is a plausible first step, but the correct repair belongs behind the Anthropic provider boundary and must retain native-profile and model-scope semantics. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 943400ea8c30. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (14 earlier review cycles; latest 8 shown)
|
Signed-off-by: Yufeng He <[email protected]>
|
The current check-lint red is a canceled self-hosted runner mid-run ( |
|
The current red is the runner again, not the change: check-lint on the latest head was cancelled mid-run (the job never produced a log, same as the July cancellation), and ci-gate only fails because of that. Could someone re-trigger the workflow? Everything that actually ran is green. |
…' into fix/anthropic-usage-reset-cooldown
|
Closing this myself. It has been a draft with declared blockers for a while (canonical The core gap the PR was after (preserve the provider-reported reset time and scope instead of the generic ladder) is still not covered upstream as far as I can tell: #136784 keeps the persisted local backoff when the probe has no authoritative deadline, which is the adjacent but different case. If I get real OAuth rate-limit/reset evidence, I will re-propose against the new structure rather than reviving this one. |
AI-assisted: AI coding agents were used to trace the auth profile cooldown path, implement this branch, and run the validation listed below.
Fixes #113159.
What Problem This Solves
Rate-limited Anthropic OAuth profiles use the generic cooldown ladder, so OpenClaw can retry before the provider's usage window resets and hit the same limit again.
Why This Change Was Made
The intended repair is to preserve the provider-reported reset time and scope through profile selection instead of replacing them with a generic profile-wide delay.
User Impact
This branch is not ready to merge. The current probe does not cover canonical Claude CLI profiles, widens model-scoped limits to the whole profile, and bypasses the provider-owned proxy-aware fetch path.
Evidence
Four focused unit tests cover exhausted and available windows, endpoint failure, and API key profiles. The full auth profile suite passed 1420 tests and focused lint passed. The endpoint shape is covered by mocked responses because no live Anthropic subscription was available for an end-to-end rate-limit and reset run.
Open Blockers
claude-cliprofile through the provider seam