Fix admin authorization and harden chat requests
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user