fix(domain,application,infrastructure,backend,app-tauri,frontend): Stop demande agent préserve la conversation ouverte — arrêt sans fermeture/clôture du chat, états cohérents après cancel sur les 3 adapters de session, cellule et workstate synchronisés — #343 (QA verte)

This commit is contained in:
2026-09-13 10:03:36 +02:00
parent a1e8a6466f
commit c37638ff24
26 changed files with 1210 additions and 232 deletions

View File

@ -308,11 +308,16 @@ describe("HttpAgentGateway WS round-trip (B6 frames)", () => {
baseUrl: "https://host",
fetchImpl: async (url, init) => {
calls.push({ url, init });
const command = JSON.parse((init as { body: string }).body).command;
const response =
command === "cancel_agent_chat"
? { sessionId: "chat-1", outcome: "cancelled" }
: undefined;
return {
ok: true,
status: 200,
json: async () => undefined,
text: async () => "",
json: async () => response,
text: async () => response ? JSON.stringify(response) : "",
};
},
}),
@ -402,7 +407,10 @@ describe("HttpAgentGateway WS round-trip (B6 frames)", () => {
});
expect(chunks).toEqual([{ kind: "final", content: "Hello back" }]);
await gw.cancelAgentChat("chat-1");
await expect(gw.cancelAgentChat("chat-1")).resolves.toEqual({
sessionId: "chat-1",
outcome: "cancelled",
});
await gw.closeAgentChat("chat-1");
await gw.detachAgentChat("chat-1");