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 +1 -1
- package/src/account-manager.js +16 -3
- package/src/index.js +5 -7
- package/src/pool-link.js +8 -5
package/package.json
CHANGED
package/src/account-manager.js
CHANGED
|
@@ -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
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
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:
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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.
|
|
202
|
+
this._seedAt = savedAt ?? null;
|
|
200
203
|
}
|
|
201
204
|
}
|
|
202
205
|
|