Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
style(llm-chat): wrap the stream-interruption lines at 100 characters
Elian Doran354b9e515e7d
diff --git a/apps/client/src/services/llm_chat.spec.ts b/apps/client/src/services/llm_chat.spec.tsindex e1ecf0ef12..f55abbe670 100644--- a/apps/client/src/services/llm_chat.spec.ts+++ b/apps/client/src/services/llm_chat.spec.ts@@ -233,7 +233,7 @@ describe("streamChatCompletion", () => {expect(cb.onChunk).toHaveBeenCalledWith("hi");});- it("reports an interruption when the body ends without a done or error event (#10883)", async () => {+ it("reports an interruption when the body ends without a done or error event", async () => {const chunks = [`data: ${JSON.stringify({ type: "text", content: "only" })}\n`];vi.stubGlobal("fetch", vi.fn(async () => makeStreamResponse(chunks)));@@ -243,7 +243,8 @@ describe("streamChatCompletion", () => {expect(cb.onChunk).toHaveBeenCalledWith("only");expect(cb.onDone).not.toHaveBeenCalled();expect(cb.onError.mock.calls).toEqual([[- "LLM stream ended without completing — the connection closed before the response finished (network or proxy interruption)."+ "LLM stream ended without completing — the connection closed before the response "+ + "finished (network or proxy interruption)."]]);});diff --git a/apps/client/src/services/llm_chat.ts b/apps/client/src/services/llm_chat.tsindex 835d3f8fc9..e42b270a57 100644--- a/apps/client/src/services/llm_chat.ts+++ b/apps/client/src/services/llm_chat.ts@@ -196,7 +196,8 @@ async function streamChatOverSse(if (!completed) {callbacks.onError(- "LLM stream ended without completing — the connection closed before the response finished (network or proxy interruption)."+ "LLM stream ended without completing — the connection closed before the response "+ + "finished (network or proxy interruption).");}} catch (e) {