maxpool 1.24.57 → 1.24.59

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxpool",
3
- "version": "1.24.57",
3
+ "version": "1.24.59",
4
4
  "description": "Multi-account Claude Code proxy with adaptive, rate-aware load balancing across Claude accounts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1385,7 +1385,20 @@ export class AccountManager {
1385
1385
  const ticket = requestInfo.queueTicket;
1386
1386
  if (!ticket) return true;
1387
1387
  this._reapStaleQueueHead();
1388
- if (this.queueState.waiting[0]?.id !== ticket.id) return false;
1388
+ // BOUNDED HEAD-SKIP (council red-team #5, 2026-10-31): strict FIFO let an
1389
+ // unserveable HEAD (claude-profile with every Claude weekly-walled) block a
1390
+ // serveable follower (all-profile, healthy GLM) for the head's full window —
1391
+ // up to 25 min of "pool dead" while capacity idled. A waiter that has already
1392
+ // waited HEAD_SKIP_MS may be admitted even when tickets ahead of it exist.
1393
+ // Fairness stays: the skip only fires after a real wait, and the head's own
1394
+ // window (queueAndRetry's ceiling) still bounds IT.
1395
+ const HEAD_SKIP_MS = 60_000;
1396
+ if (this.queueState.waiting[0]?.id === ticket.id) {
1397
+ // fast path: unchanged FIFO
1398
+ } else {
1399
+ const waited = Date.now() - (ticket.queuedAt ?? Date.now());
1400
+ if (waited < HEAD_SKIP_MS) return false;
1401
+ }
1389
1402
  const now = Date.now();
1390
1403
  if (now < this.queueState.rampUntil && now - this.queueState.lastAdmissionAt < 250) return false;
1391
1404
  this.queueState.waiting.shift();
package/src/tui.js CHANGED
@@ -2771,9 +2771,16 @@ export class TUI {
2771
2771
  // views — a 5h tank refills ~33.6x per week, so the weekly figure is what a
2772
2772
  // month of subscription actually buys. '--' until a tank reading AND a price exist.
2773
2773
  const sesTankObj = this.am.capacityTank?.(i, 'ses');
2774
+ // Weekly-plan accounts: a measured weekly tank, or the derived form ses × 5.5 —
2775
+ // MEASURED weekly tanks run 5-7× the 5h tank (2026-10-31: glm1 1.27M→8.58M,
2776
+ // glm2 1.26M→6.85M, max+4 1.53M→7.21M): the weekly window holds ~5 full 5h
2777
+ // refills, not 33.6. The owner caught the ×33.6 error here ("your math seems
2778
+ // completely off"). weeklyAbsent plans (no weekly limit at all) keep ×33.6.
2779
+ const WK_PER_SES = 5.5;
2774
2780
  const wkTank = (a.quota?.weeklyAbsent && a.type === 'provider')
2775
2781
  ? (sesTankObj?.avg ? Math.round(sesTankObj.avg * (7 * 24) / 5) : null)
2776
- : (this.am.capacityTank?.(i, 'wk')?.avg ?? null);
2782
+ : (this.am.capacityTank?.(i, 'wk')?.avg
2783
+ ?? (a.type === 'provider' && sesTankObj?.avg ? Math.round(sesTankObj.avg * WK_PER_SES) : null));
2777
2784
  const price = this.am.monthlyPriceFor?.(a);
2778
2785
  const priceCell = (wkTank && price)
2779
2786
  ? '$' + (price / (wkTank / 1e6)).toFixed(2)