fix(sos-stream): undefined 'key' var nach cutover-refactor
Im Cutover wurde 'const key = config.openrouterApiKey' rausgenommen, aber line 311 referenzierte 'key' weiter für extractAndStoreMemories. ReferenceError fiel in catch → 'stream failed' SSE event → App fiel auf non-streaming fallback (4-5s wait) statt streaming. Fix: explizit memoryExtractKey aus config.openrouterApiKey holen.
This commit is contained in:
parent
cc0fd8f7fa
commit
431ae6a75d
@ -308,7 +308,10 @@ export default defineEventHandler(async (event) => {
|
||||
...messages,
|
||||
{ role: "assistant", content: fullText.split("[[CHIPS]]:")[0].trim() },
|
||||
];
|
||||
extractAndStoreMemories(user.id, allMessages, sessionId, key).catch(
|
||||
// Memory-extraction nutzt OpenRouter unabhängig vom user-toggle (Sonnet/Haiku/Groq) —
|
||||
// Memory extraction ist eigener LLM-call, kein Bezug zur SOS-Antwort
|
||||
const memoryExtractKey = (config.openrouterApiKey as string | undefined) ?? "";
|
||||
extractAndStoreMemories(user.id, allMessages, sessionId, memoryExtractKey).catch(
|
||||
() => {},
|
||||
);
|
||||
} catch (err) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user