From 56fe6ac5965ac4ae9de15fdcd07d439efa192311 Mon Sep 17 00:00:00 2001 From: Anton Bogdanovich <27antonb@gmail.com> Date: Mon, 11 May 2026 14:06:45 -0700 Subject: [PATCH] test(agent): deflake queued voice steering --- pkg/agent/steering_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/agent/steering_test.go b/pkg/agent/steering_test.go index 23d34840e..9a2ec09bb 100644 --- a/pkg/agent/steering_test.go +++ b/pkg/agent/steering_test.go @@ -935,11 +935,24 @@ func TestAgentLoop_Run_QueuedVoiceMessageIsTranscribedBeforeSteering(t *testing. subCtx, subCancel := context.WithTimeout(context.Background(), 5*time.Second) defer subCancel() + + var out1 bus.OutboundMessage select { - case <-msgBus.OutboundChan(): + case out1 = <-msgBus.OutboundChan(): case <-subCtx.Done(): t.Fatal("expected outbound response") } + if out1.Content != "continued response" { + t.Fatalf("expected continued response, got %q", out1.Content) + } + + noExtraCtx, cancelNoExtra := context.WithTimeout(context.Background(), 200*time.Millisecond) + defer cancelNoExtra() + select { + case out2 := <-msgBus.OutboundChan(): + t.Fatalf("expected stale direct response to be suppressed, got extra outbound %q", out2.Content) + case <-noExtraCtx.Done(): + } cancelRun() select {