History

test: update codex header expectations

Luis Pater committed 7 months agov6.9.8

Commit 4f99bc51 parent 913f4a92 files · +12 −12Browse files

Unified · Split

2 files
  1. internal/runtime/executor/codex_executor_cache_test.go +2 −2
  2. internal/runtime/executor/codex_websockets_executor_test.go +10 −10
internal/runtime/executor/codex_executor_cache_test.go+2−2
@@ -42,8 +42,8 @@ func TestCodexExecutorCacheHelper_OpenAIChatCompletions_StablePromptCacheKeyFrom · 41 unmodified lines
4242 if gotKey != expectedKey {
4343 t.Fatalf("prompt_cache_key = %q, want %q", gotKey, expectedKey)
4444 }
45− if gotConversation := httpReq.Header.Get("Conversation_id"); gotConversation != expectedKey {
46− t.Fatalf("Conversation_id = %q, want %q", gotConversation, expectedKey)
45+ if gotConversation := httpReq.Header.Get("Conversation_id"); gotConversation != "" {
46+ t.Fatalf("Conversation_id = %q, want empty", gotConversation)
4747 }
4848 if gotSession := httpReq.Header.Get("Session_id"); gotSession != expectedKey {
4949 t.Fatalf("Session_id = %q, want %q", gotSession, expectedKey)
internal/runtime/executor/codex_websockets_executor_test.go+10−10
@@ -38,8 +38,8 @@ func TestApplyCodexWebsocketHeadersDefaultsToCurrentResponsesBeta(t *testing.T) · 37 unmodified lines
3838 if got := headers.Get("OpenAI-Beta"); got != codexResponsesWebsocketBetaHeaderValue {
3939 t.Fatalf("OpenAI-Beta = %s, want %s", got, codexResponsesWebsocketBetaHeaderValue)
4040 }
41− if got := headers.Get("User-Agent"); got != codexUserAgent {
42− t.Fatalf("User-Agent = %s, want %s", got, codexUserAgent)
41+ if got := headers.Get("User-Agent"); got != "" {
42+ t.Fatalf("User-Agent = %s, want empty", got)
4343 }
4444 if got := headers.Get("Version"); got != "" {
4545 t.Fatalf("Version = %q, want empty", got)
@@ -97,8 +97,8 @@ func TestApplyCodexWebsocketHeadersUsesConfigDefaultsForOAuth(t *testing.T) { · 51 unmodified lines
9797
9898 headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "", cfg)
9999
100− if got := headers.Get("User-Agent"); got != "my-codex-client/1.0" {
101− t.Fatalf("User-Agent = %s, want %s", got, "my-codex-client/1.0")
100+ if got := headers.Get("User-Agent"); got != "" {
101+ t.Fatalf("User-Agent = %s, want empty", got)
102102 }
103103 if got := headers.Get("x-codex-beta-features"); got != "feature-a,feature-b" {
104104 t.Fatalf("x-codex-beta-features = %s, want %s", got, "feature-a,feature-b")
@@ -129,8 +129,8 @@ func TestApplyCodexWebsocketHeadersPrefersExistingHeadersOverClientAndConfig(t * · 24 unmodified lines
129129
130130 got := applyCodexWebsocketHeaders(ctx, headers, auth, "", cfg)
131131
132− if gotVal := got.Get("User-Agent"); gotVal != "existing-ua" {
133− t.Fatalf("User-Agent = %s, want %s", gotVal, "existing-ua")
132+ if gotVal := got.Get("User-Agent"); gotVal != "" {
133+ t.Fatalf("User-Agent = %s, want empty", gotVal)
134134 }
135135 if gotVal := got.Get("x-codex-beta-features"); gotVal != "existing-beta" {
136136 t.Fatalf("x-codex-beta-features = %s, want %s", gotVal, "existing-beta")
@@ -155,8 +155,8 @@ func TestApplyCodexWebsocketHeadersConfigUserAgentOverridesClientHeader(t *testi · 18 unmodified lines
155155
156156 headers := applyCodexWebsocketHeaders(ctx, http.Header{}, auth, "", cfg)
157157
158− if got := headers.Get("User-Agent"); got != "config-ua" {
159− t.Fatalf("User-Agent = %s, want %s", got, "config-ua")
158+ if got := headers.Get("User-Agent"); got != "" {
159+ t.Fatalf("User-Agent = %s, want empty", got)
160160 }
161161 if got := headers.Get("x-codex-beta-features"); got != "client-beta" {
162162 t.Fatalf("x-codex-beta-features = %s, want %s", got, "client-beta")
@@ -177,8 +177,8 @@ func TestApplyCodexWebsocketHeadersIgnoresConfigForAPIKeyAuth(t *testing.T) { · 14 unmodified lines
177177
178178 headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "sk-test", cfg)
179179
180− if got := headers.Get("User-Agent"); got != codexUserAgent {
181− t.Fatalf("User-Agent = %s, want %s", got, codexUserAgent)
180+ if got := headers.Get("User-Agent"); got != "" {
181+ t.Fatalf("User-Agent = %s, want empty", got)
182182 }
183183 if got := headers.Get("x-codex-beta-features"); got != "" {
184184 t.Fatalf("x-codex-beta-features = %q, want empty", got)