From 6f52d7020c68e38f9874d99e7657a3458c74107e Mon Sep 17 00:00:00 2001 From: luulam Date: Mon, 7 Sep 2026 15:23:48 +0700 Subject: [PATCH] fix(chatCore): add missing capsOverride + streamErrorPatterns to destructure * handleChatCore() referenced capsOverride (line 162) and streamErrorPatterns (line 475) but the destructured param list did not include them. Callers that did not pass these (e.g. open-sse/handlers/responsesHandler.js, unit callers, older client builds) would trigger 'capsOverride is not defined' / 'streamErrorPatterns is not defined' ReferenceError mid-request. * Both defaulted to null. capsOverride is read by capability merge (line 162, already guarded by '|| {}'). streamErrorPatterns is read in the early-peek hook (line 484) which was null-safe only because the variable happened to be in scope when chat.js spread it in; responsesHandler never passed it and would crash. * Unblocks all callers regardless of which fields they pass. --- open-sse/handlers/chatCore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-sse/handlers/chatCore.js b/open-sse/handlers/chatCore.js index b106a2b2..75c13f4e 100644 --- a/open-sse/handlers/chatCore.js +++ b/open-sse/handlers/chatCore.js @@ -59,7 +59,7 @@ export function stripContinuityFields(body) { return body; } -export async function handleChatCore({ body, modelInfo, credentials, log, onCredentialsRefreshed, onRequestSuccess, onDisconnect, clientRawRequest, connectionId, userAgent, apiKey, ccFilterNaming, rtkEnabled, headroomEnabled, headroomUrl, headroomCompressUserMessages, headroomTimeoutMs, cavemanEnabled, cavemanLevel, ponytailEnabled, ponytailLevel, pxpipeEnabled, pxpipeMinChars, pxpipeTimeoutMs, pxpipeTransform, onPxpipeEvent, sourceFormatOverride, providerThinking }) { +export async function handleChatCore({ body, modelInfo, credentials, log, onCredentialsRefreshed, onRequestSuccess, onDisconnect, clientRawRequest, connectionId, userAgent, apiKey, ccFilterNaming, rtkEnabled, headroomEnabled, headroomUrl, headroomCompressUserMessages, headroomTimeoutMs, cavemanEnabled, cavemanLevel, ponytailEnabled, ponytailLevel, pxpipeEnabled, pxpipeMinChars, pxpipeTimeoutMs, pxpipeTransform, onPxpipeEvent, sourceFormatOverride, providerThinking, capsOverride = null, streamErrorPatterns = null }) { const { provider, model } = modelInfo; const requestStartTime = Date.now(); // Stable per-session color so all lines of one CLI conversation share a tag