maxpool 1.5.62 → 1.5.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/account-manager.js +19 -6
package/package.json
CHANGED
package/src/account-manager.js
CHANGED
|
@@ -2154,7 +2154,18 @@ export class AccountManager {
|
|
|
2154
2154
|
if (q.unified7d == null) return 'unknown';
|
|
2155
2155
|
|
|
2156
2156
|
const used = clamp01(q.unified7d);
|
|
2157
|
-
|
|
2157
|
+
// NEVER bench on utilization alone while the upstream explicitly says the account is
|
|
2158
|
+
// ALLOWED. Anthropic reports both a percentage and a verdict; the verdict is the
|
|
2159
|
+
// authority, and it keeps saying "allowed"/"allowed_warning" at 100% used. This mirrors
|
|
2160
|
+
// _isAccountWideRejected above, which already treats an explicit 'rejected' as decisive
|
|
2161
|
+
// for the negative case — the positive case was simply missing.
|
|
2162
|
+
// Measured 2026-08-06: max@gomokka.com sat benched at unified7d=1.00 with
|
|
2163
|
+
// unifiedStatus='allowed_warning' and returned 200 to a live request. Capacity the user
|
|
2164
|
+
// was waiting on, withheld because a threshold outranked the upstream's own answer.
|
|
2165
|
+
// 'exhausted' is the only state that removes an account from routing, so the override
|
|
2166
|
+
// is scoped to it — critical/reserve still apply their soft costs unchanged.
|
|
2167
|
+
const upstreamAllows = typeof q.unifiedStatus === 'string' && q.unifiedStatus.startsWith('allowed');
|
|
2168
|
+
if (used >= this.scheduler.weeklyExhaustedThreshold && !upstreamAllows) return 'exhausted';
|
|
2158
2169
|
if (used >= this.scheduler.weeklyCriticalThreshold) return 'critical';
|
|
2159
2170
|
if (used >= this.scheduler.weeklyReserveThreshold) return 'reserve';
|
|
2160
2171
|
if (used >= this.scheduler.weeklySoftThreshold) return 'soft';
|
|
@@ -2264,11 +2275,13 @@ export class AccountManager {
|
|
|
2264
2275
|
q.lastProbeErrorAt = Date.now();
|
|
2265
2276
|
q.lastProbeErrorStatus = Number.isFinite(status) ? status : null;
|
|
2266
2277
|
// ESCALATE A SYSTEMIC PROBE FAILURE. These fields were written and never read by
|
|
2267
|
-
// anything, so a probe
|
|
2268
|
-
//
|
|
2269
|
-
//
|
|
2270
|
-
//
|
|
2271
|
-
//
|
|
2278
|
+
// anything, so a probe failing on every call would do so in total silence.
|
|
2279
|
+
// (Correction: an earlier version of this comment claimed the Anthropic quota probe was
|
|
2280
|
+
// dead because /v1/usages and /v1/usage 404. Those are the KIMI PROVIDER endpoints
|
|
2281
|
+
// (src/oauth.js fetchProviderUsage). Anthropic's OAuth quota endpoint is
|
|
2282
|
+
// /api/oauth/usage and it is healthy — every account carries a recent lastProbeOkAt and
|
|
2283
|
+
// zero consecutive failures, and this escalation has never fired. The guard is still
|
|
2284
|
+
// worth having; the diagnosis that motivated it was wrong.)
|
|
2272
2285
|
q.consecutiveProbeFailures = (q.consecutiveProbeFailures || 0) + 1;
|
|
2273
2286
|
const n = q.consecutiveProbeFailures;
|
|
2274
2287
|
// Once, at a threshold that cannot be a blip, then every 100th so it stays visible
|