add response versioning support in messages for regeneration improvements

This commit is contained in:
2026-09-22 14:48:13 +02:00
parent 7602692341
commit 72e429b1b3
15 changed files with 591 additions and 86 deletions
+14
View File
@@ -77,6 +77,7 @@ test("thinking streams separately and survives reload, retry, branch and import"
assert.equal(bot.content, "Answer");
const retry = await api(`/chats/${chatId}/messages/${bot.id}/retry`, {});
assert.equal(retry.message.thinking, undefined);
await api(`/chats/${chatId}/messages/${bot.id}/versions/0`, {});
const branch = await api(`/chats/${chatId}/messages/${bot.id}/branch`, {confirmed: true});
assert.equal(branch.messages.at(-1).thinking, bot.thinking);
const exported = await api(`/exports/chats/${chatId}?format=json`);
@@ -125,6 +126,19 @@ test("thinking streams separately and survives reload, retry, branch and import"
assert.match(roleplayWire, /event: done/);
assert.ok(requests.at(-1).messages.some(message => message.content.includes("Guide")));
assert.equal(requests.at(-1).think, true);
const roleplayMessages = (await api(`/chats/${roleplay.chat.id}/messages`)).messages;
for (const target of [roleplayMessages[0], roleplayMessages.at(-1)]) {
const retryResponse = await fetch(base + `/chats/${roleplay.chat.id}/messages/${target.id}/retry/stream`, {
method: "POST", headers: {"Content-Type": "application/json", Cookie: cookie},
body: JSON.stringify({model: "qwen3:14b", reasoning: true})
});
const retryWire = await retryResponse.text();
assert.match(retryWire, /event: thinking/);
assert.match(retryWire, /event: chunk/);
assert.match(retryWire, /event: done/);
assert.ok(requests.at(-1).messages.some(message => message.content.includes("Guide")));
assert.equal(requests.at(-1).think, true);
}
});
test("reasoning disclosure is collapsed, preserves open state and renders text safely", (t) => {