maxpool 1.24.87 → 1.24.89

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.87",
3
+ "version": "1.24.89",
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",
@@ -1879,6 +1879,17 @@ export class AccountManager {
1879
1879
  return !sourceDying;
1880
1880
  }
1881
1881
 
1882
+ /** C3: a listing failure holds an active lift LIFT_GRACE_MS from the FIRST failure
1883
+ * of the streak — measured from the last good read, a failure late in the 5-min
1884
+ * cycle left ~3 min of hold (live 2026-11-11). A good listing rewrites capLift,
1885
+ * which ends the streak. */
1886
+ _holdLiftThroughFailure(account, now = Date.now()) {
1887
+ const st = account.capLift;
1888
+ if (!st?.active || st.failingSince != null) return;
1889
+ st.failingSince = now;
1890
+ st.graceUntil = Math.max(st.graceUntil ?? 0, now + LIFT_GRACE_MS);
1891
+ }
1892
+
1882
1893
  /** True while the account's usage cap is suspended by a held full-refill reset. */
1883
1894
  capLiftActive(account, now = Date.now()) {
1884
1895
  if (!account || account.enabled === false) return false;
@@ -1915,7 +1926,9 @@ export class AccountManager {
1915
1926
  const st = account.capLift;
1916
1927
  if (!st) return null;
1917
1928
  if (st.mode !== 'giveback') return null; // full lift
1918
- const cap = Number(account.capUtilization) || 0;
1929
+ // Uncapped: the line it would otherwise stop at is the last-resort tier.
1930
+ const cap = account.capUtilization != null ? Number(account.capUtilization) || 0
1931
+ : this.scheduler.weeklyCriticalThreshold;
1919
1932
  if (account.remote) return Number.isFinite(st.ceiling) ? st.ceiling : cap;
1920
1933
  const drop = Number(account.giveBack?.drop);
1921
1934
  return Number.isFinite(drop) && drop > 0 ? Math.min(1, cap + drop) : cap;
@@ -1933,10 +1946,10 @@ export class AccountManager {
1933
1946
  let active = false;
1934
1947
  let mode = null;
1935
1948
  let sources = []; // the resets that carry the lift (their expiry decides the refill hold)
1936
- // No cap configured → nothing to lift (starting a lift on an uncapped account
1937
- // would remap its ordinary weekly tiers and log noise for no benefit).
1938
- const capFloor = account.capUtilization;
1939
- if (capFloor != null && account.enabled !== false && !account.poolBenchedBy && !account.refreshDead && !account.subscriptionGone) {
1949
+ // Capped OR uncapped (owner 2026-11-11): an uncapped account above 0.95 weekly
1950
+ // tiers last-resort and never reaches the 0.99 claim point, so its full reset
1951
+ // sat unspent while GLM took the load. The lift applies to every holder.
1952
+ if (account.enabled !== false && !account.poolBenchedBy && !account.refreshDead && !account.subscriptionGone) {
1940
1953
  const rg = account.resetGrants;
1941
1954
  const cards = account.resetCards;
1942
1955
  const listingOk = rg && rg.stale !== true && rg.eligible !== false
@@ -4418,6 +4431,7 @@ export class AccountManager {
4418
4431
  if (account.resetGrants) {
4419
4432
  account.resetGrants = { ...account.resetGrants, stale: true, lastError: String(listing.error), lastErrorAt: now };
4420
4433
  }
4434
+ this._holdLiftThroughFailure(account, now);
4421
4435
  return;
4422
4436
  }
4423
4437
  account.resetGrants = {
@@ -4476,6 +4490,7 @@ export class AccountManager {
4476
4490
  if (account.resetCards) {
4477
4491
  account.resetCards = { ...account.resetCards, stale: true, lastError: String(cards.error), lastErrorAt: Date.now() };
4478
4492
  }
4493
+ this._holdLiftThroughFailure(account);
4479
4494
  return;
4480
4495
  }
4481
4496
  // DRIFT = a 200 the parser can't have meant (pre-mortem #17): expected arrays
@@ -4488,6 +4503,7 @@ export class AccountManager {
4488
4503
  if (account.resetCards) {
4489
4504
  account.resetCards = { ...account.resetCards, stale: true, lastError: 'listing drift (unexpected payload shape)', lastErrorAt: Date.now() };
4490
4505
  }
4506
+ this._holdLiftThroughFailure(account);
4491
4507
  return;
4492
4508
  }
4493
4509
  account.resetCards = {
package/src/tui.js CHANGED
@@ -40,7 +40,7 @@ const NAME_W = 20; // a.name.slice(0, NAME_W).padEnd(NAME_W) — fits a
40
40
  const WHERE_W = 5; // 'Local' / 'Cloud' — where the account is provisioned
41
41
  const PROVIDER_W = 9; // providerLabel(a).padEnd(PROVIDER_W) — fits "Anthropic"
42
42
  const STATUS_W = 13; // rpad(status, STATUS_W) — fits "throttled 59s"
43
- const RESETS_W = 8; // 'Rst' column — FIXED width (fits '2Fable' / '1~119d'); a variable
43
+ const RESETS_W = 13; // 'Rst' column — FIXED width (fits '1+3Fable~118d': count AND expiry, owner 2026-11-11); a variable
44
44
  // width ('0' vs '1~21d') shifted every quota bar per row.
45
45
  const ROW_PREFIX = ' '; // ' ' + sel(1) + cur(1) + ' ' — 4 cols before the name
46
46