From fca3bca19d2e4443ab22e6a1f399a1590fa7bea3 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 18:38:00 -0500 Subject: [PATCH] test(tui): wait for connection before tool event (#36958) Co-authored-by: Aiden Cline --- packages/tui/test/cli/tui/data.test.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/tui/test/cli/tui/data.test.tsx b/packages/tui/test/cli/tui/data.test.tsx index 444d0bb2ff..53c51d6d14 100644 --- a/packages/tui/test/cli/tui/data.test.tsx +++ b/packages/tui/test/cli/tui/data.test.tsx @@ -764,8 +764,10 @@ test("classifies live tool rows independently of their call ID", async () => { if (url.pathname === `/api/session/${sessionID}/message`) return json({ data: [], cursor: {} }) }, events) let rows!: ReturnType + let client!: ReturnType function Probe() { + client = useClient() rows = createSessionRows(() => sessionID) return } @@ -783,6 +785,7 @@ test("classifies live tool rows independently of their call ID", async () => { )) try { + await wait(() => client.connection.status() === "connected") emitEvent(events, { id: "evt_tool_started", created: 1,