Skip to content

Port PR #523: improve account rotation timeout safety#6

Merged
insign merged 9 commits intomainfrom
port-pr-523
Apr 1, 2026
Merged

Port PR #523: improve account rotation timeout safety#6
insign merged 9 commits intomainfrom
port-pr-523

Conversation

@insign
Copy link
Copy Markdown
Owner

@insign insign commented Apr 1, 2026

Port of archived upstream PR NoeFabris#523 from https://github.com/NoeFabris/opencode-antigravity-auth/pull/523\n\nOriginal author: @9nunya\n\nNotes:\n- Cherry-picked all upstream commits from PR NoeFabris#523\n- Verified locally with npm test

9nunya added 8 commits April 1, 2026 01:52
…safety

- Implement AbortSignal.timeout (180s default) to prevent hanging on stuck accounts
- Fix TUI/web server freeze by immediately exiting request loop on user interrupt
- Add proactive pool quota refresh when majority of accounts are rate-limited
- MARK unhealthy accounts on timeout to trigger automatic rotation

(cherry picked from commit 52d9b51)
- AccountManager.shouldRefreshAllQuotas now includes soft quota checks in its blockedCount calculation
- AccountManager.updateQuotaCache now uses stable refreshToken instead of stale positional index
- Quota results now include refreshToken for reliable identification during async refreshes

(cherry picked from commit f12df55)
- Increase default request_timeout_seconds to 600s (10 mins)
- Apply 3x multiplier for streaming requests (max 30 mins) to prevent premature timeouts on active streams
- Fix actualTimeoutSec logic in catch block by moving declaration outside try scope

(cherry picked from commit b1306a4)
- Ensure proactive quota refresh only triggers on the first endpoint attempt
- Persist account cooldown state immediately after a request timeout
- Refine shouldRefreshAllQuotas to use family-specific rate limiting check
- Update test descriptions to match implementation (75% or more)

(cherry picked from commit a4745c1)
- Improve AbortSignal.any polyfill with proper listener cleanup
- Add AbortSignal.timeout guard and fallback for older Node.js versions
- Implement mergeAbortSignals helper for safe signal combination
- Add exhaustive listener cleanup on signal abortion

(cherry picked from commit 2b9b575)
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@9nunya
Copy link
Copy Markdown

9nunya commented Apr 1, 2026

thx bro i dont mind if u skid my work ily :D

@insign
Copy link
Copy Markdown
Owner Author

insign commented Apr 1, 2026 via email

@insign insign merged commit a91c5b6 into main Apr 1, 2026
@insign insign deleted the port-pr-523 branch April 1, 2026 18:06
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.

2 participants