| @@ -38,8 +38,8 @@ func TestApplyCodexWebsocketHeadersDefaultsToCurrentResponsesBeta(t *testing.T) · 37 unmodified lines |
| 38 | if got := headers.Get("OpenAI-Beta"); got != codexResponsesWebsocketBetaHeaderValue { | 38 | if got := headers.Get("OpenAI-Beta"); got != codexResponsesWebsocketBetaHeaderValue { |
| 39 | t.Fatalf("OpenAI-Beta = %s, want %s", got, codexResponsesWebsocketBetaHeaderValue) | 39 | t.Fatalf("OpenAI-Beta = %s, want %s", got, codexResponsesWebsocketBetaHeaderValue) |
| 40 | } | 40 | } |
| 41 | if got := headers.Get("User-Agent"); got != codexUserAgent { | 41 | if got := headers.Get("User-Agent"); got != "" { |
| 42 | t.Fatalf("User-Agent = %s, want %s", got, codexUserAgent) | 42 | t.Fatalf("User-Agent = %s, want empty", got) |
| 43 | } | 43 | } |
| 44 | if got := headers.Get("Version"); got != "" { | 44 | if got := headers.Get("Version"); got != "" { |
| 45 | t.Fatalf("Version = %q, want empty", got) | 45 | t.Fatalf("Version = %q, want empty", got) |
| @@ -97,8 +97,8 @@ func TestApplyCodexWebsocketHeadersUsesConfigDefaultsForOAuth(t *testing.T) { · 51 unmodified lines |
| 97 | | 97 | |
| 98 | headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "", cfg) | 98 | headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "", cfg) |
| 99 | | 99 | |
| 100 | if got := headers.Get("User-Agent"); got != "my-codex-client/1.0" { | 100 | if got := headers.Get("User-Agent"); got != "" { |
| 101 | t.Fatalf("User-Agent = %s, want %s", got, "my-codex-client/1.0") | 101 | t.Fatalf("User-Agent = %s, want empty", got) |
| 102 | } | 102 | } |
| 103 | if got := headers.Get("x-codex-beta-features"); got != "feature-a,feature-b" { | 103 | if got := headers.Get("x-codex-beta-features"); got != "feature-a,feature-b" { |
| 104 | t.Fatalf("x-codex-beta-features = %s, want %s", got, "feature-a,feature-b") | 104 | t.Fatalf("x-codex-beta-features = %s, want %s", got, "feature-a,feature-b") |
| @@ -129,8 +129,8 @@ func TestApplyCodexWebsocketHeadersPrefersExistingHeadersOverClientAndConfig(t * · 24 unmodified lines |
| 129 | | 129 | |
| 130 | got := applyCodexWebsocketHeaders(ctx, headers, auth, "", cfg) | 130 | got := applyCodexWebsocketHeaders(ctx, headers, auth, "", cfg) |
| 131 | | 131 | |
| 132 | if gotVal := got.Get("User-Agent"); gotVal != "existing-ua" { | 132 | if gotVal := got.Get("User-Agent"); gotVal != "" { |
| 133 | t.Fatalf("User-Agent = %s, want %s", gotVal, "existing-ua") | 133 | t.Fatalf("User-Agent = %s, want empty", gotVal) |
| 134 | } | 134 | } |
| 135 | if gotVal := got.Get("x-codex-beta-features"); gotVal != "existing-beta" { | 135 | if gotVal := got.Get("x-codex-beta-features"); gotVal != "existing-beta" { |
| 136 | t.Fatalf("x-codex-beta-features = %s, want %s", gotVal, "existing-beta") | 136 | t.Fatalf("x-codex-beta-features = %s, want %s", gotVal, "existing-beta") |
| @@ -155,8 +155,8 @@ func TestApplyCodexWebsocketHeadersConfigUserAgentOverridesClientHeader(t *testi · 18 unmodified lines |
| 155 | | 155 | |
| 156 | headers := applyCodexWebsocketHeaders(ctx, http.Header{}, auth, "", cfg) | 156 | headers := applyCodexWebsocketHeaders(ctx, http.Header{}, auth, "", cfg) |
| 157 | | 157 | |
| 158 | if got := headers.Get("User-Agent"); got != "config-ua" { | 158 | if got := headers.Get("User-Agent"); got != "" { |
| 159 | t.Fatalf("User-Agent = %s, want %s", got, "config-ua") | 159 | t.Fatalf("User-Agent = %s, want empty", got) |
| 160 | } | 160 | } |
| 161 | if got := headers.Get("x-codex-beta-features"); got != "client-beta" { | 161 | if got := headers.Get("x-codex-beta-features"); got != "client-beta" { |
| 162 | t.Fatalf("x-codex-beta-features = %s, want %s", got, "client-beta") | 162 | t.Fatalf("x-codex-beta-features = %s, want %s", got, "client-beta") |
| @@ -177,8 +177,8 @@ func TestApplyCodexWebsocketHeadersIgnoresConfigForAPIKeyAuth(t *testing.T) { · 14 unmodified lines |
| 177 | | 177 | |
| 178 | headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "sk-test", cfg) | 178 | headers := applyCodexWebsocketHeaders(context.Background(), http.Header{}, auth, "sk-test", cfg) |
| 179 | | 179 | |
| 180 | if got := headers.Get("User-Agent"); got != codexUserAgent { | 180 | if got := headers.Get("User-Agent"); got != "" { |
| 181 | t.Fatalf("User-Agent = %s, want %s", got, codexUserAgent) | 181 | t.Fatalf("User-Agent = %s, want empty", got) |
| 182 | } | 182 | } |
| 183 | if got := headers.Get("x-codex-beta-features"); got != "" { | 183 | if got := headers.Get("x-codex-beta-features"); got != "" { |
| 184 | t.Fatalf("x-codex-beta-features = %q, want empty", got) | 184 | t.Fatalf("x-codex-beta-features = %q, want empty", got) |