maxpool 1.24.96 → 1.24.98

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.96",
3
+ "version": "1.24.98",
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",
package/src/server.js CHANGED
@@ -1377,6 +1377,13 @@ async function forwardRequest(
1377
1377
  && !requestInfo.queueHeartbeatActive) {
1378
1378
  ensureQueueHeartbeatInterval(res, requestInfo, Math.max(1000, Number(queueConfig?.heartbeatMs) || 10_000));
1379
1379
  }
1380
+ // A refusal the cloud pool relays (4xx, not 429 — those have their own branches)
1381
+ // used to pass through with nothing logged here, so a 400 on a ☁ row had no
1382
+ // recorded reason on this side (2026-11-16: 13 instant 400/404s, cause unknowable).
1383
+ // Keep the first bytes while relaying them unchanged; log the reason at the end,
1384
+ // the same line shape as the direct path.
1385
+ const refusalTap = (upRes.status >= 400 && upRes.status < 500 && upRes.status !== 429) ? [] : null;
1386
+ let refusalTapBytes = 0;
1380
1387
  if (upRes.body) {
1381
1388
  const reader = upRes.body.getReader();
1382
1389
  // R3-3/r4: bound the link body like the direct path bounds its stream
@@ -1417,11 +1424,18 @@ async function forwardRequest(
1417
1424
  accountManager.noteConversationServed?.(requestInfo, account);
1418
1425
  tapLinkUsage(value, requestInfo);
1419
1426
  }
1427
+ if (refusalTap && refusalTapBytes < 4096) { refusalTap.push(Buffer.from(value)); refusalTapBytes += value.length; }
1420
1428
  res.write(Buffer.from(value));
1421
1429
  }
1422
1430
  } finally { try { await reader.cancel(); } catch { /* already done */ } }
1423
1431
  if (upRes.status < 300) tapLinkUsage(null, requestInfo); // flush the non-stream tail
1424
1432
  }
1433
+ if (refusalTap) {
1434
+ const text = Buffer.concat(refusalTap).toString('utf8');
1435
+ let why = text;
1436
+ try { why = JSON.parse(text)?.error?.message || text; } catch { /* not JSON — log raw */ }
1437
+ console.log(`[Maxpool] ${upRes.status} from "${account.name}": ${String(why).slice(0, 300)}`);
1438
+ }
1425
1439
  res.end(); // an empty 2xx body: the heartbeat reaps itself on res.writableEnded
1426
1440
  finishLink({ success: ctx.status < 500, status: ctx.status });
1427
1441
  // SC22 no-double-count: this request was counted at auth; the serving pool
package/src/tui.js CHANGED
@@ -3326,7 +3326,11 @@ export class TUI {
3326
3326
  for (const tag of settingsTags(this.am, a)) note += ` ${tag}`;
3327
3327
 
3328
3328
  const bars = [];
3329
- if (showFable) bars.push(`Fbl ${scopedWeeklyBar(q, 'fable', bw)}`);
3329
+ // Fable is an Anthropic model family: a provider (GLM, Kimi, …) has no such limit,
3330
+ // so its row shows blank space where an OAuth row draws "Fbl <bar>" (owner
3331
+ // 2026-11-16: "why does it say Fable for GLM? That makes no sense"). Same visible
3332
+ // width ("Fbl " + bar), so Ses and Wk stay in the OAuth rows' columns.
3333
+ if (showFable) bars.push(' '.repeat(4 + bw));
3330
3334
  if (showSession) bars.push(`Ses ${sesCell}`);
3331
3335
  if (showBoth) bars.push(`Wk ${wkCell}`);
3332
3336
  let line = ` ${sel}${cur} ${name} ${whereCell(a)} ${type} ${status} ${bars.join(' ')}`;
package/src/updater.js CHANGED
@@ -3,6 +3,7 @@ import { promisify } from 'node:util';
3
3
  import { readFile } from 'node:fs/promises';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { dirname, join } from 'node:path';
6
+ import { homedir } from 'node:os';
6
7
 
7
8
  const execFileAsync = promisify(execFile);
8
9
  const PACKAGE = 'maxpool';
@@ -58,10 +59,14 @@ export async function checkForUpdate(currentVersion, { timeoutMs = 4000, registr
58
59
  }
59
60
  }
60
61
 
61
- /** Run `npm install -g maxpool@latest`. Returns {ok, output|error}. */
62
+ /** Run `npm install -g maxpool@latest`. Returns {ok, output|error}.
63
+ * npm runs from the home directory, never the inherited cwd: the pool lives for days,
64
+ * and a launch directory deleted under it (2026-11-16 workspace wipe+restore) made
65
+ * every `npm i -g` die at startup with ENOENT uv_cwd — a global install never needs
66
+ * the caller's cwd. */
62
67
  export async function selfUpdate({ timeoutMs = 120_000 } = {}) {
63
68
  try {
64
- const { stdout, stderr } = await execFileAsync('npm', ['install', '-g', `${PACKAGE}@latest`], { timeout: timeoutMs });
69
+ const { stdout, stderr } = await execFileAsync('npm', ['install', '-g', `${PACKAGE}@latest`], { timeout: timeoutMs, cwd: homedir() });
65
70
  return { ok: true, output: (stdout || stderr || '').trim() };
66
71
  } catch (err) {
67
72
  return { ok: false, error: err.message };