maxpool 1.8.8 → 1.8.9

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.8.8",
3
+ "version": "1.8.9",
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/index.js CHANGED
@@ -33,7 +33,7 @@ import { loginOAuth, fetchProfile, refreshAccessToken, isTokenExpiringSoon, toke
33
33
  import { TUI } from './tui.js';
34
34
  import { RestartController } from './restart-controller.js';
35
35
  import { resolveAccounts } from './account-config.js';
36
- import { maybeCheckForUpdate, getCurrentVersion, markApplied, clearQuarantine, getBootVersion } from './updater.js';
36
+ import { maybeCheckForUpdate, getCurrentVersion, markApplied, clearQuarantine, captureBootVersion } from './updater.js';
37
37
  import {
38
38
  runReloadBaton,
39
39
  RELOAD_SWAPPED, RELOAD_ROLLED_BACK,
@@ -577,6 +577,10 @@ async function serverWorkerCommand() {
577
577
 
578
578
  const threshold = config.switchThreshold || 0.90;
579
579
  const accountManager = new AccountManager(accounts, threshold, config.scheduler || {});
580
+ // The EXECUTING build: a disk read taken NOW, before any self-install can rewrite
581
+ // package.json. Fire-and-forget — the status endpoint reports null until it lands
582
+ // (milliseconds), never a wrong number.
583
+ captureBootVersion().then(v => { accountManager.runningVersion = v; }).catch(() => {});
580
584
  // (macOS) Keep the system awake ONLY while there is work in flight or queued, so a
581
585
  // long overnight streaming request survives Maintenance Sleep; the Mac sleeps
582
586
  // normally when idle. Disable via `preventSleep: false` in config.
@@ -1259,8 +1263,6 @@ async function serverWorkerCommand() {
1259
1263
  // pass the real config so they still respect the user's autoUpdate choice.
1260
1264
  const cfg = forceInstall ? { ...config, autoUpdate: true } : config;
1261
1265
  const r = await maybeCheckForUpdate(cfg, notifyUpdate, info => { accountManager.versionInfo = info; }, { announce });
1262
- // Capture the EXECUTING version for /maxpool/status (see AccountManager.getStatus).
1263
- accountManager.runningVersion = getBootVersion();
1264
1266
  apply(r);
1265
1267
  return r;
1266
1268
  } catch { return undefined; /* update path is best-effort; never break the proxy */ }
package/src/updater.js CHANGED
@@ -92,8 +92,18 @@ export function __resetUpdaterState() { _bootVersion = undefined; _lastAttempted
92
92
  * with every commit) is not what is running. Measured 2026-08-23: the status endpoint
93
93
  * answered 1.8.7 for a process executing 1.8.6, and a post-deploy check keyed on that
94
94
  * number verified the wrong build. */
95
+ export async function captureBootVersion() {
96
+ // Read the disk ONCE, at process start, BEFORE any self-install can rewrite it — that
97
+ // read IS the executing version. (_bootVersion is the same value; it is populated
98
+ // lazily by the first maybeCheckForUpdate, which is up to 30 minutes after boot, so
99
+ // reading it at construction returns null — the bug in the first version of this fix.)
100
+ if (_bootVersion === undefined) _bootVersion = await getCurrentVersion();
101
+ return _bootVersion ?? null;
102
+ }
103
+
104
+ /** The already-captured executing version; null before captureBootVersion(). */
95
105
  export function getBootVersion() {
96
- return _bootVersion ?? null; // null only before the first maybeCheckForUpdate
106
+ return _bootVersion ?? null;
97
107
  }
98
108
 
99
109
  /** Mark a version as ATTEMPTED-to-apply. The caller calls this at the moment it triggers