From 25cebb3ceabfb6a7cae86b5879dc2a2c8778b1d6 Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Mon, 23 Nov 2026 00:51:01 -0500 Subject: [PATCH] test(server): steady the side answer queue test that blocked desktop releases "keeps the queue held when a newer turn fails before the side answer ends" waited for exactly two provider sends in total. Astra's side answer is also a send, and it can reach the provider before or after the thread's new turn, so the total sometimes went from 1 straight to 3 and the wait timed out. It failed about half the time locally and failed main's CI on a78c1c674, which blocked three nightly desktop releases. The wait now counts only sends to the thread's own agent. --- .../orchestration/Layers/ProviderCommandReactor.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts index 768103ca6..3ced4bd35 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts @@ -4620,7 +4620,14 @@ describe("ProviderCommandReactor", () => { runtimeMode: "full-access", createdAt: now, }); - await waitFor(() => harness.sendTurn.mock.calls.length === 2); + // Count only the thread's own turns: astra's side answer can reach the + // provider before or after this one, so the total is not a fixed number. + await waitFor( + () => + harness.sendTurn.mock.calls.filter( + ([request]) => (request as { threadId: string }).threadId === threadId, + ).length === 2, + ); await dispatch({ type: "thread.session.set", commandId: CommandId.make("cmd-newer-turn-failed"),