diff --git a/frontend/src/features/layout/LayoutGrid.chat.test.tsx b/frontend/src/features/layout/LayoutGrid.chat.test.tsx index ff41c1dc..5091bab6 100644 --- a/frontend/src/features/layout/LayoutGrid.chat.test.tsx +++ b/frontend/src/features/layout/LayoutGrid.chat.test.tsx @@ -182,7 +182,7 @@ describe("LayoutGrid custom agent CLI (#147)", () => { expect(screen.getAllByText(/mock-attachment.txt/).length).toBeGreaterThan(0); }); - it("keeps the target announcement overlay visible in custom mode while busy (#232)", async () => { + it("keeps custom CLI visible while busy and locks only the composer (#247)", async () => { const gateways = await seeded(structuredProfile); const layout = gateways.layout as MockLayoutGateway; const workState = gateways.workState as MockWorkStateGateway; @@ -218,8 +218,14 @@ describe("LayoutGrid custom agent CLI (#147)", () => { renderGrid(gateways); expect(await screen.findByTestId("custom-agent-chat-view")).toBeTruthy(); - expect(await screen.findByTestId("target-announcements-overlay")).toBeTruthy(); - expect(screen.getByText("Travaille sur une demande de Main.")).toBeTruthy(); + expect(screen.queryByTestId("target-announcements-overlay")).toBeNull(); + expect(screen.getByText("Busy · Main")).toBeTruthy(); + await waitFor(() => + expect(screen.getByLabelText(/message CLI custom/)).toHaveProperty( + "disabled", + true, + ), + ); }); it("renders requester-side delegation fallback in custom mode after remount (#232)", async () => { @@ -265,13 +271,13 @@ describe("LayoutGrid custom agent CLI (#147)", () => { const view = renderGrid(gateways); expect(await screen.findByTestId("custom-agent-chat-view")).toBeTruthy(); - expect(await screen.findByText("Délégation en cours.")).toBeTruthy(); + expect(await screen.findByText("Worker attend Architect")).toBeTruthy(); view.unmount(); renderGrid(gateways); expect(await screen.findByTestId("custom-agent-chat-view")).toBeTruthy(); - expect(await screen.findByText("Délégation en cours.")).toBeTruthy(); + expect(await screen.findByText("Worker attend Architect")).toBeTruthy(); }); it("persists custom CLI composer height per layout cell", async () => { diff --git a/frontend/src/features/layout/LayoutGrid.tsx b/frontend/src/features/layout/LayoutGrid.tsx index 196047a5..c99802f3 100644 --- a/frontend/src/features/layout/LayoutGrid.tsx +++ b/frontend/src/features/layout/LayoutGrid.tsx @@ -1561,11 +1561,10 @@ function LeafView({ )} {/* F3 (ticket #4): while another agent is talking to THIS agent (target), - an availability veil showing its live réflexions. Driven by the target's - busy state (agentBusyChanged + read-model hydration), never by the raw - PTY — it retracts at idle even when a turn ends without a completion - event. Self-guards on `active` (busy) and renders null otherwise. */} - {!modelServerOverlay && agentId != null && ( + an availability veil showing its live réflexions. Native TUI cells + need the full-cell guard; custom CLI cells keep the canonical busy + badge and composer lock only, matching their normal chat turn flow. */} + {!modelServerOverlay && cellMode !== "custom" && agentId != null && (