fix(webui): resume queued prompts after turn completion (#6242)

* fix(webui): resume queued prompts after turn completion

Persist the lifecycle turn each queued prompt waits for and use canonical completion identities to resume after navigation or reconnect. Release one entry at a time, and retain stopped or rejected entries for manual sending.

* fix(webui): drain temporary chat prompts on live completion

* perf(webui): resume queued prompts from live completion
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-16 13:33:41 +08:00
1 parent 3abcfe70c5
commit 836092424d
6 files changed
+339 -36

No files matched your search

+4
View File
@@ -582,6 +582,7 @@ describe("NanobotClient", () => {
expect(client.getRunStartedAt("chat-stop")).toBeNull();
expect(client.hasUnsettledRun("chat-stop")).toBe(false);
expect(client.isRunCompleted("chat-stop", "turn-stop")).toBe(true);
expect(handler).toHaveBeenLastCalledWith("chat-stop", null);
});
@@ -609,6 +610,7 @@ describe("NanobotClient", () => {
expect(client.status).toBe("reconnecting");
expect(client.getRunStartedAt("chat-strip")).toBe(12_345);
expect(client.getRunTurnId("chat-strip")).toBe("turn-strip");
expect(client.isRunCompleted("chat-strip", "turn-strip")).toBe(false);
expect(client.getUnsettledRunChatIds()).toEqual(["chat-strip"]);
expect(handler).toHaveBeenCalledTimes(1);
await vi.advanceTimersByTimeAsync(20);
@@ -621,6 +623,8 @@ describe("NanobotClient", () => {
});
expect(client.getRunStartedAt("chat-strip")).toBeNull();
expect(client.getUnsettledRunChatIds()).toEqual([]);
expect(client.isRunCompleted("chat-strip", "turn-strip")).toBe(true);
expect(client.isRunCompleted("another-chat", "turn-strip")).toBe(false);
expect(handler).toHaveBeenLastCalledWith("chat-strip", null);
client.close();
});