add generation cancellation middleware and refactor chat/message workflows to support HTTP client disconnections
CI / check (22) (push) Failing after 4m54s
CI / check (24) (push) Failing after 4m54s

This commit is contained in:
2026-10-05 23:21:42 +02:00
parent c48e1b17c4
commit 1c0f06716e
17 changed files with 620 additions and 172 deletions
+22
View File
@@ -0,0 +1,22 @@
import test from "node:test";
import assert from "node:assert/strict";
test("conversation navigation", async t => {
const original = Object.fromEntries(["document", "window", "history", "location"].map(key => [key, globalThis[key]]));
const elements = new Map();
globalThis.document = {
getElementById(id) {
if (!elements.has(id)) elements.set(id, {value: "", textContent: "", querySelectorAll: () => []});
return elements.get(id);
},
querySelectorAll: () => [], querySelector: () => null
};
globalThis.location = {pathname: "/app/chats/1", search: ""};
globalThis.window = {location: globalThis.location};
globalThis.history = {replaceState(_data, _unused, path) { globalThis.location.pathname = path; }};
t.after(() => { for (const [key, value] of Object.entries(original)) globalThis[key] = value; });
const {registerConversationTests} = await import("../browser-tests/conversationCases.js");
const cases = [];
registerConversationTests((name, run) => cases.push({name, run}), assert);
for (const {name, run} of cases) await t.test(name, run);
});