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:
1 parent
90ff8191ff
commit
fd22290a34
17 files changed
+1000
-35
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { clearAllPoolUnfit } from "open-sse/services/proxyPoolFitness.js";
|
||||
|
||||
// POST /api/proxy-pools/fitness/clear-all
|
||||
// Body: { provider?: string } — clears every mark, or only marks scoped to the
|
||||
// given provider ("provider::*") when provided.
|
||||
export async function POST(request) {
|
||||
try {
|
||||
let body = {};
|
||||
try {
|
||||
body = await request.json();
|
||||
} catch {
|
||||
body = {};
|
||||
}
|
||||
const provider = typeof body?.provider === "string" && body.provider.trim() ? body.provider.trim() : null;
|
||||
clearAllPoolUnfit(provider);
|
||||
return NextResponse.json({ ok: true, provider: provider || null });
|
||||
} catch (error) {
|
||||
console.log("Error clearing proxy fitness:", error);
|
||||
return NextResponse.json({ error: "Failed to clear proxy fitness" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user