refactor(openai): remove special handling for x-codex-turn-id

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-11-27 21:13:23 +08:00
co-authored by Codex
parent 5173314136
commit 81dacf603f
6 changed files with 1 additions and 10 deletions
@@ -20,7 +20,6 @@ pub(crate) struct CodexRequestHeaders {
version: Option<String>,
codex_window_id: Option<String>,
parent_thread_id: Option<String>,
turn_id: Option<String>,
responses_lite: Option<String>,
memgen_request: Option<String>,
subagent: Option<String>,
@@ -45,7 +44,6 @@ impl CodexRequestHeaders {
version: header_string(headers, "version"),
codex_window_id: header_string(headers, "x-codex-window-id"),
parent_thread_id: header_string(headers, "x-codex-parent-thread-id"),
turn_id: header_string(headers, "x-codex-turn-id"),
responses_lite: header_string(headers, X_OPENAI_INTERNAL_CODEX_RESPONSES_LITE_HEADER),
memgen_request: header_string(headers, X_OPENAI_MEMGEN_REQUEST_HEADER),
subagent: header_string(headers, OPENAI_SUBAGENT_KEY),
@@ -60,7 +58,6 @@ impl CodexRequestHeaders {
("version", self.version.as_ref()),
("codex_window_id", self.codex_window_id.as_ref()),
("parent_thread_id", self.parent_thread_id.as_ref()),
("turn_id", self.turn_id.as_ref()),
("responses_lite", self.responses_lite.as_ref()),
("memgen_request", self.memgen_request.as_ref()),
] {
@@ -45,7 +45,7 @@ impl CodexBackendClient {
|| is_transport_managed_request_header(name.as_str())
|| is_non_codex_request_header(name.as_str())
// Live 不继承 Responses 的路由或连接续接状态
|| matches!(name.as_str(), "x-codex-routing-hint" | "x-codex-turn-state" | "x-codex-turn-id")
|| matches!(name.as_str(), "x-codex-routing-hint" | "x-codex-turn-state")
{
continue;
}
@@ -283,7 +283,6 @@ pub(super) fn append_passthrough_headers(headers: &mut HeaderMap, passthrough: &
| "content-type"
| "content-encoding"
| "x-codex-routing-hint"
| "x-codex-turn-id"
| X_OPENAI_INTERNAL_CODEX_RESPONSES_LITE_HEADER
)
{
@@ -247,7 +247,6 @@ async fn backend_websocket_should_forward_context_headers_and_preserve_payload_f
for forbidden in [
"x-codex-turn-state",
"x-codex-installation-id",
"x-codex-turn-id",
"x-openai-internal-codex-residency",
"accept",
"content-type",
@@ -383,7 +382,6 @@ async fn backend_http_should_send_codex_context_without_browser_headers() {
assert_eq!(header_names, expected_names);
for forbidden in [
"x-codex-installation-id",
"x-codex-turn-id",
"x-openai-internal-codex-residency",
"sec-ch-ua",
"sec-ch-ua-mobile",
@@ -459,7 +457,6 @@ async fn backend_http_should_ignore_unrepresentable_protocol_headers_without_blo
for omitted in [
"session-id",
"thread-id",
"x-codex-turn-id",
"x-codex-window-id",
"x-codex-turn-state",
"x-codex-turn-metadata",
@@ -69,7 +69,6 @@ async fn each_core_endpoint_uses_the_current_bundled_release() {
assert_eq!(headers["chatgpt-account-id"], "audit-account");
for forbidden in [
"x-codex-installation-id",
"x-codex-turn-id",
"x-openai-internal-codex-residency",
"oai-language",
"openai-beta",
@@ -122,7 +122,6 @@ async fn fetch_should_use_wham_usage_headers_only() {
"session_id",
"session-id",
"thread-id",
"x-codex-turn-id",
"x-codex-window-id",
"x-codex-turn-state",
"x-codex-turn-metadata",