fix(cli): les annonces MCP/inter-agent restent affichées pendant qu'un agent est busy — #232

This commit is contained in:
2026-08-21 19:40:13 +02:00
parent a51813fc44
commit aa85d4dfc8
6 changed files with 258 additions and 32 deletions

View File

@ -95,6 +95,21 @@ describe("F3 — overlay lifecycle is the target's busy state", () => {
expect(overlay()).not.toBeNull();
});
it("shows a stable busy fallback when no live announcement text exists", async () => {
const { system } = setup(
<TargetAnnouncementsOverlay
projectId="p1"
agentId="agent-T"
fallbackText="Travaille sur une demande de Main."
/>,
);
await flush();
act(() => system.emit(busy("agent-T", true)));
expect(screen.getByText("Travaille sur une demande de Main.")).not.toBeNull();
});
it("RETRACTS on busy:false even when NO completion event is emitted", async () => {
// The regression the arbitrage targets: a turn that ends without any
// completion signal (interruption / error / crash) must still bring the
@ -209,6 +224,20 @@ describe("F3 — overlay lifecycle is the target's busy state", () => {
});
describe("F2 — AnnouncementsPreview (requester filter)", () => {
it("shows a requester-side fallback while waiting without live text", async () => {
setup(
<AnnouncementsPreview
requester="agent-A"
fallbackActive
fallbackText="Délégation en cours."
/>,
);
await flush();
expect(screen.getByTestId("announcements-preview")).not.toBeNull();
expect(screen.getByText("Délégation en cours.")).not.toBeNull();
});
it("shows the requester's own announcements and hides another's", async () => {
const { system } = setup(<AnnouncementsPreview requester="agent-A" />);
await flush();