maxpool 1.24.54 → 1.24.55

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.54",
3
+ "version": "1.24.55",
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",
@@ -4774,6 +4774,13 @@ export class AccountManager {
4774
4774
  this.applyPoolLinks();
4775
4775
  }
4776
4776
 
4777
+ /** When these identities were last CONFIRMED by a good poll (a seed keeps its own
4778
+ * age, so the expiry in seedPoolIdentities can actually fire in a long outage). */
4779
+ poolIdentitiesAt() {
4780
+ const times = this.poolLinks.map(l => l.lastOkAt ?? l._seedAt ?? 0);
4781
+ return times.length ? Math.max(...times) : null;
4782
+ }
4783
+
4777
4784
  /** Per-link identity maps for state.json (keyed by link name). */
4778
4785
  exportPoolIdentities() {
4779
4786
  const out = {};
@@ -4804,9 +4811,15 @@ export class AccountManager {
4804
4811
  const remoteRow = (this.poolLinks || [])
4805
4812
  .flatMap(l => (l.status?.accounts || []).filter(r => r.name === d.remoteName))[0];
4806
4813
  if (remoteRow?.refreshDead && !a.refreshDead && a.refreshToken) {
4807
- const msg = `[Maxpool] Token divergence: team pool's "${d.remoteName}" is refreshDead but local "${a.name}" holds a live token — run /login on the local row to re-auth the team pool (one keystroke), or the account stays dark on both sides`;
4808
- console.log(msg);
4809
- appendEventLog(msg);
4814
+ // Once per episode: this runs on every 30s poll.
4815
+ if (!a._divergenceLogged) {
4816
+ a._divergenceLogged = true;
4817
+ const msg = `[Maxpool] Token divergence: team pool's "${d.remoteName}" needs login while local "${a.name}" still has a stored token — log in again on that row, or the account stays unavailable on both sides`;
4818
+ console.log(msg);
4819
+ appendEventLog(msg);
4820
+ }
4821
+ } else {
4822
+ a._divergenceLogged = false;
4810
4823
  }
4811
4824
  }
4812
4825
  a.poolBenchedBy = d ? (d.remoteName || 'team pool') : null;
package/src/index.js CHANGED
@@ -648,12 +648,6 @@ async function serverWorkerCommand() {
648
648
  // final flush and restores fully (the reported zero-request case).
649
649
  if (savedState?.runtimeProviders) accountManager.restoreRuntimeProviders(savedState.runtimeProviders);
650
650
  if (savedState?.callerStats) accountManager.restoreCallerStats?.(savedState.callerStats);
651
- // Boot-time single-writer guard: seed each link's identity map from the last
652
- // persisted run so a boot during a link outage doesn't un-bench local copies
653
- // (red-team 2026-10-31). Replaced by the first successful poll.
654
- if (savedState?.poolIdentities) {
655
- accountManager.seedPoolLinks?.(savedState.poolIdentities, savedState.poolIdentitiesAt);
656
- }
657
651
 
658
652
  // ── config-sourced providers (GCP Secret Manager) ──────────────────────────
659
653
  // Provider keys (GLM, Kimi) defined in the config's `providers` section, each
@@ -709,6 +703,10 @@ async function serverWorkerCommand() {
709
703
  // as its own row (syncRemoteMirrors on every link poll) and balanced with the
710
704
  // local accounts by the unchanged routing logic.
711
705
  accountManager.setPoolLinks(links);
706
+ // Boot-time single-writer guard: seed from the last persisted run in the SAME
707
+ // tick as setPoolLinks, before the first poll or probe can run. Links must exist
708
+ // first (a seed above this point looped over an empty list and did nothing).
709
+ accountManager.seedPoolLinks(savedState?.poolIdentities, savedState?.poolIdentitiesAt);
712
710
  const armed = links.filter(l => l.key).length;
713
711
  console.log(`[Maxpool] Team pools: ${armed} linked${links.length - armed ? `, ${links.length - armed} unresolved key` : ''}`);
714
712
  } catch (err) {
@@ -756,7 +754,7 @@ async function serverWorkerCommand() {
756
754
  // Last-good remote identity maps — the boot-time single-writer guard reads
757
755
  // these (see restore above). Rides the same generation-guarded payload.
758
756
  poolIdentities: accountManager.exportPoolIdentities?.() || null,
759
- poolIdentitiesAt: Date.now(),
757
+ poolIdentitiesAt: accountManager.poolIdentitiesAt?.() ?? null,
760
758
  },
761
759
  { expectedGeneration },
762
760
  )
package/src/pool-link.js CHANGED
@@ -149,10 +149,13 @@ function sanitizeRemoteStatus(json) {
149
149
  for (const a of Array.isArray(p.accounts) ? p.accounts : []) if (a && typeof a === 'object') a.name = safeText(a.name);
150
150
  }
151
151
  }
152
- if (json.callers && typeof json.callers === 'object') {
153
- const clean = {};
154
- for (const [k, v] of Object.entries(json.callers)) clean[safeText(k)] = v;
155
- json.callers = clean;
152
+ // Person names key both maps; the People page reads callerWindows.
153
+ for (const field of ['callers', 'callerWindows']) {
154
+ if (json[field] && typeof json[field] === 'object') {
155
+ const clean = {};
156
+ for (const [k, v] of Object.entries(json[field])) clean[safeText(k)] = v;
157
+ json[field] = clean;
158
+ }
156
159
  }
157
160
  return json;
158
161
  }
@@ -196,7 +199,7 @@ export class PoolLink {
196
199
  const m = new Map(Object.entries(saved).map(([k, v]) => [k, v]));
197
200
  if (m.size > 0) {
198
201
  this.identities = m;
199
- this._bootSeeded = true;
202
+ this._seedAt = savedAt ?? null;
200
203
  }
201
204
  }
202
205