feat(runtime): add user-controlled turn recovery

This commit is contained in:
Xubin Ren
2026-08-24 00:58:04 +08:00
parent ffa58aa5ef
commit 12029f8812
60 changed files with 4027 additions and 169 deletions
+28
View File
@@ -4007,4 +4007,32 @@ describe("ThreadShell", () => {
expect(screen.getByRole("option", { name: /Other project/i })).toBeInTheDocument();
});
it("allows a new turn after a completed recovery state", async () => {
const client = makeClient();
render(wrap(
client,
<ThreadShell
session={session("recovered-chat")}
title="Recovered chat"
onToggleSidebar={() => {}}
/>,
));
const input = await screen.findByLabelText("Message input");
act(() => {
client._emitChat("recovered-chat", {
event: "recovery_state",
chat_id: "recovered-chat",
recovery_id: "recovery-1",
status: "recovered",
});
});
fireEvent.change(input, { target: { value: "start the next task" } });
fireEvent.click(screen.getByRole("button", { name: "Send message" }));
expect(client.sendMessage).toHaveBeenCalledOnce();
expect(screen.getByRole("button", { name: "Stop response" })).toBeInTheDocument();
});
});