diff --git a/backend/internal/service/openai_first_output_timeout_test.go b/backend/internal/service/openai_first_output_timeout_test.go index d3970413e0..fc4b5076ca 100644 --- a/backend/internal/service/openai_first_output_timeout_test.go +++ b/backend/internal/service/openai_first_output_timeout_test.go @@ -168,7 +168,8 @@ func TestNewOpenAIFirstOutputTimeoutErrorRecordsCallerProxyAttribution(t *testin raw, ok := c.Get(OpsUpstreamErrorsKey) require.True(t, ok) - events := raw.([]*OpsUpstreamErrorEvent) + events, ok := raw.([]*OpsUpstreamErrorEvent) + require.True(t, ok) require.Len(t, events, 2) require.Equal(t, "first_output_timeout", events[0].Kind) require.Nil(t, events[0].ProxyID) diff --git a/backend/internal/service/openai_ws_fallback_test.go b/backend/internal/service/openai_ws_fallback_test.go index 622e609e0f..b9f5c39b64 100644 --- a/backend/internal/service/openai_ws_fallback_test.go +++ b/backend/internal/service/openai_ws_fallback_test.go @@ -195,7 +195,8 @@ func TestWriteOpenAIWSFallbackErrorResponseKeepsManagedProxy(t *testing.T) { raw, ok := c.Get(OpsUpstreamErrorsKey) require.True(t, ok) - events := raw.([]*OpsUpstreamErrorEvent) + events, ok := raw.([]*OpsUpstreamErrorEvent) + require.True(t, ok) require.Len(t, events, 1) require.NotNil(t, events[0].ProxyID) require.Equal(t, proxyID, *events[0].ProxyID) diff --git a/backend/internal/service/ops_queue_sanitize_test.go b/backend/internal/service/ops_queue_sanitize_test.go index 9a1a1cd646..8ace57d9bb 100644 --- a/backend/internal/service/ops_queue_sanitize_test.go +++ b/backend/internal/service/ops_queue_sanitize_test.go @@ -107,13 +107,13 @@ func TestSanitizeOpsUpstreamErrorsForQueueHardBoundsSerializedBytes(t *testing.T const total = opsUpstreamErrorsMaxEvents for i := 0; i < total; i++ { entry.UpstreamErrors = append(entry.UpstreamErrors, &OpsUpstreamErrorEvent{ - AtUnixMs: int64(i + 1), - Platform: strings.Repeat("p", 40), - AccountName: strings.Repeat("a", 200), - ProxyName: strings.Repeat("n", 200), - UpstreamRequestID: strings.Repeat("r", 200), - UpstreamStatusCode: 502, - UpstreamURL: "https://example.com/" + strings.Repeat("u", 3000), + AtUnixMs: int64(i + 1), + Platform: strings.Repeat("p", 40), + AccountName: strings.Repeat("a", 200), + ProxyName: strings.Repeat("n", 200), + UpstreamRequestID: strings.Repeat("r", 200), + UpstreamStatusCode: 502, + UpstreamURL: "https://example.com/" + strings.Repeat("u", 3000), // Plain-text payloads are truncated, not JSON-trimmed, so they keep // their full queue-limit weight. UpstreamResponseBody: strings.Repeat("b", 10_000),