maxpool 1.20.0 → 1.20.1

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.20.0",
3
+ "version": "1.20.1",
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",
@@ -124,8 +124,12 @@ const DEFAULT_SCHEDULER = {
124
124
  // CONCURRENCY HEADROOM for the request (an at-cap route cannot serve without
125
125
  // deepening the congestion). Congestion-based, not presence-based: an idle provider
126
126
  // or reserve account keeps serving and no unlock fires — critical becomes relief
127
- // exactly when the fleet is out of headroom, and never preempts an idle route
128
- // (cost is also ABOVE reserve's attainable max ~19, pinning the ordering).
127
+ // exactly when the fleet is out of headroom, and never preempts an idle route.
128
+ // Ordering vs reserve: reserve's attainable max is floor(5) + band(≤8) + weekly
129
+ // scarcity(≤6) ≈ 19, PLUS utilization's weekly term (≤3, 2026-09-16) ⇒ up to ~22 —
130
+ // this 21 sits above a lightly-priced reserve but can sit BELOW a maxed one. The
131
+ // X3 pin holds for the idle-reserve case (0.90 ⇒ ~10-19); if that regresses, raise
132
+ // this to 24 (see critical-unlock.test.js X3).
129
133
  // -1 disables; 0 = unlock only when every route is at cap.
130
134
  criticalPressureUnlockRoutes: 0,
131
135
  criticalPressureCost: 21,
package/src/tui.js CHANGED
@@ -1081,7 +1081,17 @@ export class TUI {
1081
1081
  const sched = { ...(this.config.scheduler || {}) };
1082
1082
  sched.weeklyAwareScoring = next;
1083
1083
  this.config.scheduler = sched;
1084
- await this.saveConfig(this.config);
1084
+ try {
1085
+ await this.saveConfig(this.config);
1086
+ } catch (e) {
1087
+ // Roll back both the live flag and the mirror so an unsaved toggle can't
1088
+ // silently revert on the next reload — same pattern as the sibling
1089
+ // _cycleProviderClaudeFallback (tui.js).
1090
+ this.am.scheduler.weeklyAwareScoring = !next;
1091
+ this.config.scheduler = sched.weeklyAwareScoring === next ? { ...sched, weeklyAwareScoring: !next } : sched;
1092
+ this._addLog(`Could not save: ${e.message}`);
1093
+ return;
1094
+ }
1085
1095
  this._addLog(next
1086
1096
  ? 'Weekly-aware routing: ON — accounts near their weekly limit rank last, all day'
1087
1097
  : 'Weekly-aware routing: OFF — score sees only the 5h session window again');