feat(proxy-fitness): pool fitness registry + Smart rotation + pool-scoped retry
Pool/IP fitness registry (globalThis-backed, provider::model scopes, 5-min cooldown, provider::* wildcard) fed by pool-scoped failures: freebuff limited-IP / model-locked gates and opencode free per-IP limits. chatCore retries a failed pool via another pool without locking the account; new Smart rotation strategy (per-connection + no-auth providers) skips unfit pools. Proxy Fitness dashboard page: active-block table with provider/IP filters, per-record Clear and provider-scoped Clear All; egress column via pool geo enrichment. Unit tests for the registry.
This commit is contained in:
@@ -69,7 +69,14 @@ export async function parseUpstreamError(response, executor = null) {
|
||||
const parsed = executor.parseError(response, bodyText);
|
||||
if (parsed && typeof parsed === "object") {
|
||||
const msg = parsed.message || DEFAULT_ERROR_MESSAGES[response.status] || `Upstream error: ${response.status}`;
|
||||
return { statusCode: parsed.status || response.status, message: msg, resetsAtMs: parsed.resetsAtMs };
|
||||
return {
|
||||
statusCode: parsed.status || response.status,
|
||||
message: msg,
|
||||
resetsAtMs: parsed.resetsAtMs,
|
||||
// Executors declare IP/pool-scoped failures (e.g. per-IP rate limits)
|
||||
// here; chatCore completes poolId/scope and retries via another pool.
|
||||
poolScoped: parsed.poolScoped,
|
||||
};
|
||||
}
|
||||
} catch { /* fall through to default parsing */ }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user