diff --git a/open-sse/handlers/chatCore.ts b/open-sse/handlers/chatCore.ts index 90b4b1a784..7146188bc2 100644 --- a/open-sse/handlers/chatCore.ts +++ b/open-sse/handlers/chatCore.ts @@ -4134,7 +4134,7 @@ export async function handleChatCore({ try { const firstChoice = translatedResponse?.choices?.[0]; const msg = firstChoice?.message; - cacheReasoningFromAssistantMessage(msg, provider, model); + cacheReasoningFromAssistantMessage(msg, provider, model, { requestId: skillRequestId, messageIndex: 0 }); } catch { // Cache capture is non-critical — never block the response } @@ -4421,7 +4421,7 @@ export async function handleChatCore({ const body = streamResponseBody as Record; const choices = body.choices as { message?: Record }[] | undefined; const msg = choices?.[0]?.message; - cacheReasoningFromAssistantMessage(msg, provider, model); + cacheReasoningFromAssistantMessage(msg, provider, model, { requestId: skillRequestId, messageIndex: 0 }); } catch { // Cache capture is non-critical — never block the stream } diff --git a/open-sse/handlers/responseSanitizer.ts b/open-sse/handlers/responseSanitizer.ts index dfd7bb7a85..f7cbb300fc 100644 --- a/open-sse/handlers/responseSanitizer.ts +++ b/open-sse/handlers/responseSanitizer.ts @@ -28,7 +28,7 @@ const ALLOWED_RESPONSES_USAGE_FIELDS = new Set([ type JsonRecord = Record; function isDeepSeekV4Model(model: unknown): boolean { - return typeof model === "string" && /^deepseek-v4(?:$|[-_/])/i.test(model); + return typeof model === "string" && /deepseek[-/]v4/i.test(model); } function toRecord(value: unknown): JsonRecord | null {