maxpool 1.24.42 → 1.24.43

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.42",
3
+ "version": "1.24.43",
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",
@@ -2861,8 +2861,27 @@ export class AccountManager {
2861
2861
  _scoreAccount(account, requestInfo = {}, ctx = null, criticalUnlock = null) {
2862
2862
  const now = ctx?.now ?? Date.now();
2863
2863
  const reqWeight = Math.max(1, requestInfo.weight || 1);
2864
+ // POOL LINK scores as the cloud's WORST-case load (owner 2026-10-29: "the team
2865
+ // pool will respect the accounts within it... included in the balancing act").
2866
+ // The link row's inFlight is mirrored from the remote status poll, so the
2867
+ // concurrency term already treats one link request as N remote requests.
2864
2868
  const inflight = account.activeWeight + reqWeight;
2865
2869
  const refillMult = this._fastRefillMultiplier(account);
2870
+ if (account.type === 'pool' && account._link) {
2871
+ // Utilization = the cloud's own reported fraction of usable accounts spent
2872
+ // (weekly windows), so a near-exhausted cloud pool de-preferences like a
2873
+ // near-exhausted local account rather than pretending to be empty-fresh.
2874
+ const link = account._link;
2875
+ const remoteUtil = link.summary && link.summary.total
2876
+ ? (link.summary.total - link.summary.usable) / link.summary.total : 0;
2877
+ // Same shape as a provider's weekly utilization cost, keyed to remote load.
2878
+ const remoteLoad = Math.max(account.activeWeight, link.status?.scheduler?.globalInFlight || 0);
2879
+ return (
2880
+ remoteLoad * this.scheduler.concurrencyWeight
2881
+ + Math.max(0, remoteLoad - this.scheduler.perAccountConcurrencyTarget) * this.scheduler.capPenaltyWeight
2882
+ + remoteUtil * this.scheduler.capPenaltyWeight
2883
+ );
2884
+ }
2866
2885
 
2867
2886
  // DOMINANT term: in-flight concurrency. Short-term throttling is driven by
2868
2887
  // how many requests pile on one account, so least-loaded-first spread is