From 0fcec63b685f51cafaff3983dda66a718520c564 Mon Sep 17 00:00:00 2001 From: shaw Date: Mon, 31 Aug 2026 15:15:44 +0800 Subject: [PATCH] test(openai): isolate visible TTFT fixture --- .../service/openai_first_output_timeout_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/internal/service/openai_first_output_timeout_test.go b/backend/internal/service/openai_first_output_timeout_test.go index 6783de90d1..4ac568c541 100644 --- a/backend/internal/service/openai_first_output_timeout_test.go +++ b/backend/internal/service/openai_first_output_timeout_test.go @@ -403,6 +403,16 @@ func assertOpenAINativeLargeOpenEventTimesOutWithoutLeak(t *testing.T, line stri } func TestOpenAINativeFirstOutputEOFDispatchesTerminalEventWithoutBlankLine(t *testing.T) { + gatewayForwardingCache.Store(&cachedGatewayForwardingSettings{ + openAITTFTMode: OpenAITTFTModeVisible, + expiresAt: time.Now().Add(time.Minute).UnixNano(), + }) + t.Cleanup(func() { + gatewayForwardingCache.Store(&cachedGatewayForwardingSettings{ + openAITTFTMode: OpenAITTFTModeSemantic, + expiresAt: time.Now().Add(time.Minute).UnixNano(), + }) + }) cfg := &config.Config{Gateway: config.GatewayConfig{ OpenAIFirstOutputTimeoutSeconds: 1, MaxLineSize: defaultMaxLineSize,