bug: explicit prompt-cache hints fail across GPT chat forwarding
Summary
After upgrading from 0.2.7 to 0.2.8, Chat Completions requests containing explicit prompt-cache hints can fail for GPT models with upstream HTTP 400:
{"error":{"message":"prompt_cache_options is not supported on this model","type":"invalid_request_error"}}
Confirmed affected models:
gpt-5.6-solgpt-5.6-terragpt-5.6-lunagpt-6-astragpt-6-solgpt-6-luna
gpt-5.5 is included for compatibility coverage. The fix also covers GPT-5.4, suffix variants, and future gpt- models so behavior does not depend on a model whitelist.
Returning to 0.2.7 restored successful requests with the same model and cache-options fields. This points to a forwarding compatibility regression rather than general model availability.
Minimal request shape
Send POST /v1/chat/completions with a valid locally configured credential:
{
"model": "gpt-5.6-luna",
"messages": [{"role": "user", "content": "What is 2 + 3?"}],
"reasoning_effort": "none",
"stream": true,
"prompt_cache_options": {"mode": "explicit", "ttl": "30m"}
}
Cause
Commit c4c2e660704dbde070f445beac3808cc829880c1 added PromptCacheOptions to request structs and began copying it through ChatCompletionsToResponses. Some GPT upstream paths reject this explicit control. Protocol-level prompt_cache_breakpoint hints can cause the same compatibility problem, and raw Responses-shaped requests sent through /v1/chat/completions bypass the typed converter.
Expected behavior
Use the final mapped and normalized upstream model for the compatibility decision. For final model names beginning with gpt-:
- remove top-level
prompt_cache_optionsandprompt_cache_breakpoint; - remove protocol-level
prompt_cache_breakpointfrom message/content positions undermessagesandinput; - preserve
prompt_cache_keyand automatic caching; - preserve tools, function argument JSON, metadata, unrelated user data, and non-message Responses input items;
- leave non-GPT forwarding and generic protocol conversion unchanged.
Fix status
PR #7547 implements this at the OpenAI Chat forwarding layer after final model mapping and Codex normalization. It covers typed Chat Completions conversion and raw Responses-shaped compatibility requests, while retaining one commit and using this issue as the single tracker.
Related: #5803 concerns prompt_cache_retention, and #4388 concerns top-level explicit_cache.
Proposed fix: #7547. The patch and regression tests cover all six reported models: GPT-5.6 Sol/Terra/Luna and GPT-6 Astra/Sol/Luna. It targets the Chat Completions-to-Responses conversion regression and preserves existing automatic cache-key handling.