From 4f99bc54f1d7760903e86c09b32f081126558a28 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Thu, 2 Apr 2026 11:19:37 +0800 Subject: [PATCH] test: update codex header expectations --- .../executor/codex_executor_cache_test.go | 4 ++-- .../codex_websockets_executor_test.go | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/runtime/executor/codex_executor_cache_test.go b/internal/runtime/executor/codex_executor_cache_test.go index d6dca031..7a24fd96 100644 --- a/internal/runtime/executor/codex_executor_cache_test.go +++ b/internal/runtime/executor/codex_executor_cache_test.go @@ -42,8 +42,8 @@ func TestCodexExecutorCacheHelper_OpenAIChatCompletions_StablePromptCacheKeyFrom if gotKey != expectedKey { t.Fatalf("prompt_cache_key = %q, want %q", gotKey, expectedKey) } - if gotConversation := httpReq.Header.Get("Conversation_id"); gotConversation != expectedKey { - t.Fatalf("Conversation_id = %q, want %q", gotConversation, expectedKey) + if gotConversation := httpReq.Header.Get("Conversation_id"); gotConversation != "" { + t.Fatalf("Conversation_id = %q, want empty", gotConversation) } if gotSession := httpReq.Header.Get("Session_id"); gotSession != expectedKey { t.Fatalf("Session_id = %q, want %q", gotSession, expectedKey) diff --git a/internal/runtime/executor/codex_websockets_executor_test.go b/internal/runtime/executor/codex_websockets_executor_test.go index d34e7c39..dec356de 100644 --- a/internal/runtime/executor/codex_websockets_executor_test.go +++ b/internal/runtime/executor/codex_websockets_executor_test.go @@ -38,8 +38,8 @@ func TestApplyCodexWebsocketHeadersDefaultsToCurrentResponsesBeta(t *testing.T) if got := headers.Get("OpenAI-Beta"); got != codexResponsesWebsocketBetaHeaderValue { t.Fatalf("OpenAI-Beta = %s, want %s", got, codexResponsesWebsocketBetaHeaderValue) } - if got := headers.Get("User-Agent"); got != codexUserAgent { - t.Fatalf("User-Agent = %s, want %s", got, codexUserAgent) + if got := headers.Get("User-Agent"); got != "" { + t.Fatalf("User-Agent = %s, want empty", got) } if got := headers.Get("Version"); got != "" { t.Fatalf("Version = %q, want empty", got) @@ -97,8 +97,8 @@ func TestApplyCodexWebsocketHeadersUsesConfigDefaultsForOAuth(t *testing.T) { headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "", cfg) - if got := headers.Get("User-Agent"); got != "my-codex-client/1.0" { - t.Fatalf("User-Agent = %s, want %s", got, "my-codex-client/1.0") + if got := headers.Get("User-Agent"); got != "" { + t.Fatalf("User-Agent = %s, want empty", got) } if got := headers.Get("x-codex-beta-features"); got != "feature-a,feature-b" { t.Fatalf("x-codex-beta-features = %s, want %s", got, "feature-a,feature-b") @@ -129,8 +129,8 @@ func TestApplyCodexWebsocketHeadersPrefersExistingHeadersOverClientAndConfig(t * got := applyCodexWebsocketHeaders(ctx, headers, auth, "", cfg) - if gotVal := got.Get("User-Agent"); gotVal != "existing-ua" { - t.Fatalf("User-Agent = %s, want %s", gotVal, "existing-ua") + if gotVal := got.Get("User-Agent"); gotVal != "" { + t.Fatalf("User-Agent = %s, want empty", gotVal) } if gotVal := got.Get("x-codex-beta-features"); gotVal != "existing-beta" { t.Fatalf("x-codex-beta-features = %s, want %s", gotVal, "existing-beta") @@ -155,8 +155,8 @@ func TestApplyCodexWebsocketHeadersConfigUserAgentOverridesClientHeader(t *testi headers := applyCodexWebsocketHeaders(ctx, http.Header{}, auth, "", cfg) - if got := headers.Get("User-Agent"); got != "config-ua" { - t.Fatalf("User-Agent = %s, want %s", got, "config-ua") + if got := headers.Get("User-Agent"); got != "" { + t.Fatalf("User-Agent = %s, want empty", got) } if got := headers.Get("x-codex-beta-features"); got != "client-beta" { t.Fatalf("x-codex-beta-features = %s, want %s", got, "client-beta") @@ -177,8 +177,8 @@ func TestApplyCodexWebsocketHeadersIgnoresConfigForAPIKeyAuth(t *testing.T) { headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "sk-test", cfg) - if got := headers.Get("User-Agent"); got != codexUserAgent { - t.Fatalf("User-Agent = %s, want %s", got, codexUserAgent) + if got := headers.Get("User-Agent"); got != "" { + t.Fatalf("User-Agent = %s, want empty", got) } if got := headers.Get("x-codex-beta-features"); got != "" { t.Fatalf("x-codex-beta-features = %q, want empty", got)