feat(gateway): make chat turns durable and idempotent
This commit is contained in:
1 parent
80f9d92e51
commit
b876fc80cc
16 files changed
+2183
-188
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { newChatTurn, retryChatTurn } from "../src/chat/chat-retry.js";
|
||||
|
||||
test("retry preserves the logical turn identity and text", () => {
|
||||
const turn = newChatTurn("keep this message");
|
||||
const retry = retryChatTurn(turn);
|
||||
|
||||
assert.notEqual(turn.sourceID, undefined);
|
||||
assert.deepEqual(retry, turn);
|
||||
});
|
||||
|
||||
test("new turns receive distinct identities", () => {
|
||||
const first = newChatTurn("same text");
|
||||
const second = newChatTurn("same text");
|
||||
|
||||
assert.notEqual(first.sourceID, second.sourceID);
|
||||
});
|
||||
Reference in new issue
Block a user