Problem
The translator paths that convert between OpenAI/Codex, Claude, and Gemini currently drop or mishandle cache-control markers:
- Codex/OpenAI Chat→Codex drops
prompt_cache_key, prompt_cache_options, prompt_cache_breakpoint, and does not map service_tier to Codex-accepted values.
- OpenAI Responses→Codex drops client
prompt_cache_options/prompt_cache_breakpoint.
- Claude→OpenAI/Codex and Claude→Gemini drop
cache_control on content parts, messages, and tools.
- Gemini→Claude/Codex has no
cache_control handling.
Proposed change
Apply the same implementation as kaitranntt/CLIProxyAPIPlus#215:
- Add shared helpers:
ModelSupportsExplicitPromptCache, NormalizeCodexServiceTier, CopyPromptCacheBreakpoint, AttachPromptCacheBreakpoint, AttachMessagePromptCacheBreakpoint.
- Map Claude
cache_control to OpenAI/Codex prompt_cache_breakpoint when rebuilding content arrays.
- Preserve message-level
cache_control on the last content block.
- Echo
prompt_cache_key in Codex/OpenAI Responses responses.
- Propagate
prompt_cache_key/prompt_cache_retention and conditional prompt_cache_options/prompt_cache_breakpoint in Chat/Responses→Codex.
- Normalize
service_tier to Codex values.
- Document
cache_control drop in Claude→Gemini (no direct cachedContent mapping).
Plus implementation
kaitranntt/CLIProxyAPIPlus#215
Problem
The translator paths that convert between OpenAI/Codex, Claude, and Gemini currently drop or mishandle cache-control markers:
prompt_cache_key,prompt_cache_options,prompt_cache_breakpoint, and does not mapservice_tierto Codex-accepted values.prompt_cache_options/prompt_cache_breakpoint.cache_controlon content parts, messages, and tools.cache_controlhandling.Proposed change
Apply the same implementation as kaitranntt/CLIProxyAPIPlus#215:
ModelSupportsExplicitPromptCache,NormalizeCodexServiceTier,CopyPromptCacheBreakpoint,AttachPromptCacheBreakpoint,AttachMessagePromptCacheBreakpoint.cache_controlto OpenAI/Codexprompt_cache_breakpointwhen rebuilding content arrays.cache_controlon the last content block.prompt_cache_keyin Codex/OpenAI Responses responses.prompt_cache_key/prompt_cache_retentionand conditionalprompt_cache_options/prompt_cache_breakpointin Chat/Responses→Codex.service_tierto Codex values.cache_controldrop in Claude→Gemini (no directcachedContentmapping).Plus implementation
kaitranntt/CLIProxyAPIPlus#215