fix(ui): surface model retry status (NAN-34) (#5504)

This commit is contained in:
chengyongru authored and GitHub committed 2026-09-07 15:12:39 +08:00
1 parent 0b1fa0c3e4
commit b581a496a6
52 files changed
+1697 -55

No files matched your search

+8
View File
@@ -3,6 +3,14 @@ import fixtures from "../../../packages/client-events/fixtures.json";
import { acceptsCompactionPhase, decodeNotification } from "../../../packages/client-events/notifications";
describe("shared notification contract", () => {
it("rejects malformed retry counters and relative delays", () => {
const retry = { event: "retry_status", chat_id: "chat", state: "waiting",
attempt: 1, max_attempts: 4, error_kind: "connection", retry_after_s: 2 };
for (const invalid of [
{ attempt: 0 }, { attempt: 1.5 }, { max_attempts: 0 }, { max_attempts: NaN },
{ retry_after_s: -1 }, { retry_after_s: Infinity }, { state: "unknown" },
]) expect(decodeNotification({ ...retry, ...invalid })).toBeNull();
});
it.each(fixtures)("accepts the Python wire fixture %#", (event) => {
expect(decodeNotification(event)).toEqual(event);
expect(decodeNotification({ ...event, turn_id: "turn" })).toMatchObject(event);