maxpool 1.24.74 → 1.24.76

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.74",
3
+ "version": "1.24.76",
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
@@ -1005,7 +1005,7 @@ async function serverWorkerCommand() {
1005
1005
  // Headless (service / shared VM) pools have no TUI log buffer, so named-caller
1006
1006
  // attribution would otherwise reach no log at all. Only named callers are
1007
1007
  // logged here — a solo headless pool stays as quiet as before.
1008
- appendEventLog(`[Maxpool] ${info.caller} · ${info.method} ${info.path} → ${info.account || '?'} (${info.status})`);
1008
+ appendEventLog(`[Maxpool] ${info.caller} · ${info.method} ${info.path} → ${info.account || '?'} (${info.status})${info.conversation ? ` [cv ${info.conversation.slice(0, 8)}]` : ''}`);
1009
1009
  }
1010
1010
  },
1011
1011
  };
package/src/server.js CHANGED
@@ -544,6 +544,10 @@ export function createProxyServer(accountManager, config, hooks = {}) {
544
544
  method: req.method, path: req.url,
545
545
  account: ctx.account, status: ctx.status,
546
546
  caller: req.callerName || null,
547
+ // Join keys for cache analysis (2026-11-08): which conversation each turn
548
+ // belonged to, so a turn's account is exact instead of a timestamp guess.
549
+ conversation: requestInfo?.conversationHash || null,
550
+ sessionKey: headerValue(req.headers, 'x-maxpool-session') || null,
547
551
  });
548
552
  }
549
553
  } catch (err) {
@@ -3485,10 +3489,18 @@ function describeRequest(req, body) {
3485
3489
  // change within it (Claude Code relies on that for its own cache prefix), so a
3486
3490
  // short hash of those separates the main thread from each subagent.
3487
3491
  if (Array.isArray(json.messages) && json.messages.length) {
3492
+ // CONVERSATION identity for cache affinity + the [cv] log tag. MUST be stable
3493
+ // across turns of one conversation: Claude Code MOVES the cache_control marker
3494
+ // every turn (turn 1: on messages[0]; later: stripped from [0], set on the
3495
+ // newest message) — hashing it verbatim gave every turn a DIFFERENT id (all
3496
+ // 1,360 tagged turns unique on 2026-11-08), which made the affinity inert and
3497
+ // the join useless. Strip cache_control (and any future positioning hints)
3498
+ // before hashing; identity = system text + first message CONTENT.
3499
+ const stable = (v) => JSON.stringify(v, (k, val) => (k === 'cache_control' || k === '_pf') ? undefined : val);
3488
3500
  info.conversationHash = createHash('sha256')
3489
- .update(JSON.stringify(json.system ?? ''))
3501
+ .update(stable(json.system ?? ''))
3490
3502
  .update('\u0000')
3491
- .update(JSON.stringify(json.messages[0] ?? ''))
3503
+ .update(stable(json.messages[0] ?? ''))
3492
3504
  .digest('hex').slice(0, 16);
3493
3505
  }
3494
3506
  if (json.max_tokens && json.max_tokens > 16_000) weight += 1;
package/src/tui.js CHANGED
@@ -562,7 +562,7 @@ export class TUI {
562
562
  // ── server hooks ───────────────────────────────────
563
563
 
564
564
  onRequestStart(id, info) {
565
- this.active.set(id, { ...info, t: timestamp(), started: Date.now(), account: null, caller: info.caller || null });
565
+ this.active.set(id, { ...info, t: timestamp(), started: Date.now(), account: null, caller: info.caller || null, conversation: info.conversation || null });
566
566
  this.render();
567
567
  }
568
568
 
@@ -585,8 +585,15 @@ export class TUI {
585
585
  // then `ps eww -p <pid> | grep x-maxpool-session` to find the terminal. Truthiness
586
586
  // guard — a header-less request has sessionKey '' (server.js headerValue) → no tag.
587
587
  const isProvider = this.am.accounts.find(a => a.name === acct)?.type === 'provider';
588
- const tag = (isProvider && r?.sessionKey) ? ` [sess ${String(r.sessionKey).slice(0, 8)}]` : '';
589
- this._addLog(`${who}${info.method} ${info.path} → ${acct} (${info.status}, ${dur}s)${tag}`);
588
+ // Turn tags (2026-11-08): [sess <terminal>] on provider rows (unchanged), and
589
+ // [cv <conversation> <terminal>] on every row — the exact join a cache analysis
590
+ // needs between a transcript turn and the ACCOUNT that served it (previously
591
+ // only a timestamp window, too noisy to separate an account switch from cache
592
+ // expiry; peer audit 2026-11-08). Short: log stays scannable.
593
+ const provTag = (isProvider && r?.sessionKey) ? ` [sess ${String(r.sessionKey).slice(0, 8)}]` : '';
594
+ const cv = info.conversation || r?.conversation;
595
+ const cvTag = cv ? ` [cv ${cv.slice(0, 8)} ${String(info.sessionKey || r?.sessionKey || '').slice(0, 8)}]` : '';
596
+ this._addLog(`${who}${info.method} ${info.path} → ${acct} (${info.status}, ${dur}s)${provTag}${cvTag}`);
590
597
  }
591
598
 
592
599
  _addLog(msg) {