maxpool 1.24.75 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxpool",
3
- "version": "1.24.75",
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/server.js CHANGED
@@ -3489,10 +3489,18 @@ function describeRequest(req, body) {
3489
3489
  // change within it (Claude Code relies on that for its own cache prefix), so a
3490
3490
  // short hash of those separates the main thread from each subagent.
3491
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);
3492
3500
  info.conversationHash = createHash('sha256')
3493
- .update(JSON.stringify(json.system ?? ''))
3501
+ .update(stable(json.system ?? ''))
3494
3502
  .update('\u0000')
3495
- .update(JSON.stringify(json.messages[0] ?? ''))
3503
+ .update(stable(json.messages[0] ?? ''))
3496
3504
  .digest('hex').slice(0, 16);
3497
3505
  }
3498
3506
  if (json.max_tokens && json.max_tokens > 16_000) weight += 1;