From 79755e76ea1d503f0a586091c851a45700d7364a Mon Sep 17 00:00:00 2001 From: VooDisss Date: Fri, 27 Mar 2026 19:34:13 +0200 Subject: [PATCH] refactor(pr): remove forbidden translator changes Drop the chat-completions translator edits from this PR so the branch complies with the repository policy that forbids pull-request changes under internal/translator. The remaining PR stays focused on the executor-level Codex continuity fix that was validated to restore cache reuse. --- .../chat-completions/codex_openai_request.go | 3 --- .../codex_openai_request_test.go | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/internal/translator/codex/openai/chat-completions/codex_openai_request.go b/internal/translator/codex/openai/chat-completions/codex_openai_request.go index 7d24d60e..6cc701e7 100644 --- a/internal/translator/codex/openai/chat-completions/codex_openai_request.go +++ b/internal/translator/codex/openai/chat-completions/codex_openai_request.go @@ -65,9 +65,6 @@ func ConvertOpenAIRequestToCodex(modelName string, inputRawJSON []byte, stream b // Model out, _ = sjson.SetBytes(out, "model", modelName) - if v := gjson.GetBytes(rawJSON, "prompt_cache_retention"); v.Exists() { - out, _ = sjson.SetBytes(out, "prompt_cache_retention", v.Value()) - } // Build tool name shortening map from original tools (if any) originalToolNameMap := map[string]string{} diff --git a/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go b/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go index 1202980f..84c8dad2 100644 --- a/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go +++ b/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go @@ -633,19 +633,3 @@ func TestToolsDefinitionTranslated(t *testing.T) { t.Errorf("tool 'search' not found in output tools: %s", gjson.Get(result, "tools").Raw) } } - -func TestPromptCacheRetentionPreserved(t *testing.T) { - input := []byte(`{ - "model": "gpt-4o", - "prompt_cache_retention": "persistent", - "messages": [ - {"role": "user", "content": "Hello"} - ] - }`) - - out := ConvertOpenAIRequestToCodex("gpt-4o", input, true) - - if got := gjson.GetBytes(out, "prompt_cache_retention").String(); got != "persistent" { - t.Fatalf("prompt_cache_retention = %q, want %q", got, "persistent") - } -}