Skip to content

Commit 7889252

Browse files
committed
feat(poller): add enhanced rate-limit protection
1 parent 0b552e3 commit 7889252

24 files changed

Lines changed: 1378 additions & 89 deletions

dist/github.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ export interface FetchRateLimitResult {
1313
data: RateLimitResponse;
1414
timestamp: string;
1515
}
16+
export interface RateLimitErrorDetails {
17+
status: number;
18+
message: string | null;
19+
rate_limit_remaining: number | null;
20+
rate_limit_reset: number | null;
21+
retry_after_seconds: number | null;
22+
}
1623
export interface FetchRateLimitError {
1724
success: false;
1825
error: string;
1926
timestamp: string;
27+
rate_limit?: RateLimitErrorDetails;
2028
}
2129
export type FetchRateLimitOutcome = FetchRateLimitResult | FetchRateLimitError;
2230
/**

dist/poller/github.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ export interface FetchRateLimitResult {
1313
data: RateLimitResponse;
1414
timestamp: string;
1515
}
16+
export interface RateLimitErrorDetails {
17+
status: number;
18+
message: string | null;
19+
rate_limit_remaining: number | null;
20+
rate_limit_reset: number | null;
21+
retry_after_seconds: number | null;
22+
}
1623
export interface FetchRateLimitError {
1724
success: false;
1825
error: string;
1926
timestamp: string;
27+
rate_limit?: RateLimitErrorDetails;
2028
}
2129
export type FetchRateLimitOutcome = FetchRateLimitResult | FetchRateLimitError;
2230
/**

dist/poller/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export { spawnPoller, type SpawnResult, type SpawnError, type SpawnOutcome } fro
22
export { killPoller, killPollerWithVerification, isProcessRunning, type KillResult, type KillError, type KillOutcome, } from './kill';
33
export { computeSleepPlan, applyDebounce, POLL_DEBOUNCE_MS, type SleepPlan } from './sleep-plan';
44
export { performPoll, buildDiagnosticsEntry } from './perform-poll';
5+
export { applyRateLimitGate, buildRateLimitErrorEntry, classifyRateLimitError, createRateLimitControlState, handleRateLimitError, resetRateLimitControl, MAX_SECONDARY_RETRIES, SECONDARY_DEFAULT_WAIT_MS, type RateLimitControlState, type RateLimitDecision, type RateLimitEvent, type RateLimitGateResult, } from './rate-limit-control';
56
export { main, runPollerLoop, createShutdownHandler, isDiagnosticsEnabled, type LoopDeps, } from './loop';

0 commit comments

Comments
 (0)