fix(hub): always send interrupt notice when card finalize fails

If StreamingAgentCard.finish cannot patch the live card, plain-text fallback
can still succeed with partial answer text. Interrupt is terminal — always
emit the explicit 已中断 notice when the card path failed so teachers see the
abort. Harden the integration assertion with waitFor.
This commit is contained in:
2026-07-30 15:02:08 +08:00
parent ee928b5832
commit ace724c609
2 changed files with 12 additions and 7 deletions
+3 -1
View File
@@ -1611,7 +1611,9 @@ describe("trigger full lifecycle (integration)", () => {
expect(runs[0]?.status).toBe("CANCELED");
});
expect(patch).toHaveBeenCalled();
expect(rt.sentTexts).toContain("已中断当前运行。");
await vi.waitFor(() => {
expect(rt.sentTexts).toContain("已中断当前运行。");
});
});
it("denies interrupt when the operator lacks agent.cancel permission", async () => {