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.
- package/package.json +1 -1
- package/src/server.js +6 -1
package/package.json
CHANGED
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');
|