mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-01 10:15:26 +00:00
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.
This commit is contained in:
@@ -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{}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user