Skip to content

fix(api): pace account refreshes and handle Cloudflare 403 challenges - #13

Merged
Bl0ck154 merged 1 commit into
mainfrom
integrate/cloudflare-pacing-20261027
Oct 28, 2026
Merged

Bl0ck154 merged 1 commit into
mainfrom
integrate/cloudflare-pacing-20261027

Conversation

@Bl0ck154

Copy link
Copy Markdown
Owner

Problem

Refreshing many ChatGPT accounts currently fans out up to ten simultaneous requests to the usage and account-metadata endpoints. This may trigger Cloudflare's 403 challenge and prevent status refreshes for multiple accounts.

Changes

Backport upstream PR Lampese#203 to the current fork:

  • Limit concurrent usage/warm-up requests to two, with spacing between account requests.
  • Refresh metadata sequentially after usage rather than hitting both endpoints together.
  • Retry a transient 403 once after a short delay without rotating a refresh token.
  • Align metadata request headers with the established browser-like usage headers.
  • Show a clearer Cloudflare rate-limit error.

Checks

git diff --check passed. Frontend, Rust and cross-platform checks are delegated to GitHub CI; this branch has not been deployed. The change affects refresh latency with many accounts, so retain the PR as draft until CI and behavior are reviewed.

Adapted from Lampese#203.

@Bl0ck154
Bl0ck154 marked this pull request as ready for review October 28, 2026 15:57
@Bl0ck154
Bl0ck154 merged commit 75ceef5 into main Oct 28, 2026
7 checks passed
@Bl0ck154
Bl0ck154 deleted the integrate/cloudflare-pacing-20261027 branch October 28, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant