maxpool 1.21.3 → 1.21.4

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 +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxpool",
3
- "version": "1.21.3",
3
+ "version": "1.21.4",
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
@@ -3337,8 +3337,13 @@ async function streamResponse(webStream, res, status, responseHeaders, accountIn
3337
3337
  modelEchoBuffer = modelEchoBuffer ? [...modelEchoBuffer, value] : [value];
3338
3338
  const s = decoder.decode(concatUint8(modelEchoBuffer));
3339
3339
  if (s.includes('"model"') && s.includes('\n\n')) {
3340
+ // \s* — providers serialize SSE JSON with spaces ("model": "glm-5.3"),
3341
+ // Anthropic compact ("model":"…"). The tight form shipped 2026-08-31 and never
3342
+ // matched a single real z.ai byte (all 1,546 glm rows in this very session
3343
+ // leaked through it; fixture JSON was hand-written compact, so tests stayed
3344
+ // green while production leaked. 2026-09-23.
3340
3345
  const normalized = s.replace(
3341
- /("model":")[^"]+(")/,
3346
+ /("model"\s*:\s*")[^"]+(")/,
3342
3347
  `$1${requestInfo.model.replace(/["\\]/g, '\\$&')}$2`,
3343
3348
  );
3344
3349
  out = Buffer.from(normalized, 'utf8');