Fix admin authorization and harden chat requests
CI / check (22) (push) Successful in 10m3s
CI / check (24) (push) Successful in 9m34s

This commit is contained in:
2026-10-05 22:49:29 +02:00
parent e8cd13a0af
commit c48e1b17c4
38 changed files with 4897 additions and 1257 deletions
+4 -3
View File
@@ -76,11 +76,12 @@ test("thinking streams separately and survives reload, retry, branch and import"
globalThis.fetch = async () => new Response(wire);
try {
await stream("/fixture", {}, {
onThinking: data => events.push(["thinking", data.fullThinking]),
onChunk: data => events.push(["answer", data.fullReply])
onThinking: data => events.push(["thinking", data.chunk]),
onChunk: data => events.push(["answer", data.chunk])
});
} finally { globalThis.fetch = originalFetch; }
assert.deepEqual(events, [["thinking", "Consider "], ["thinking", "Consider carefully."], ["answer", "Answer"]]);
assert.deepEqual(events, [["thinking", "Consider "], ["thinking", "carefully."], ["answer", "Answer"]]);
assert.doesNotMatch(wire, /fullReply|fullThinking/);
const bot = (await api(`/chats/${chatId}/messages`)).messages.at(-1);
assert.equal(bot.thinking, "Consider carefully.");
assert.equal(bot.content, "Answer");