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:
MUH. IQRAM BAHRING
2026-08-07 03:51:19 +08:00
parent 90ff8191ff
commit fd22290a34
17 changed files with 1000 additions and 35 deletions
+8 -1
View File
@@ -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 */ }
}