You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Refactor] Extract API request retry & error handling into ApiRequestHandler from Task.ts #24
Extract the API request lifecycle, retry logic, exponential backoff, rate limiting, and context-window error recovery from src/core/task/Task.ts into a dedicated ApiRequestHandler module.
Scope
Methods to extract:
attemptApiRequest()
maybeWaitForProviderRateLimit()
backoffAndAnnounce()
Context-window exceeded error recovery logic
State owned:
currentRequestAbortController?: AbortController
Retry counters (in stack items)
Rate limit tracking (lastGlobalApiRequestTime)
Estimated size: ~400–500 lines
Notes
The retry/backoff state machine is currently buried deep inside recursivelyMakeClineRequests. Extracting it makes retry behaviour independently testable and removes one of the largest, highest-complexity clusters from Task.ts.
Activity