Add `Model.resolve_prompt_cache_retention()` to resolve effective prompt-cache retention from model settings
Adds Model.resolve_prompt_cache_retention(model_settings) — the effective prompt-cache retention a request's settings ask for, owned by the model layer that understands its own settings (the issue's sketch #1). Base returns None; adapters override:
- OpenAI (Chat + Responses):
openai_prompt_cache_retention='24h'→ 24h; the provider's ~10-minute default staysNonehere (the profile-default fallback arrives with #6337). - Anthropic: the
anthropic_cache/_instructions/_tool_definitions/_messagesfamily —'1h'anywhere → 1h, any truthy → 5m. - Bedrock / OpenRouter: mirror their own
bedrock_cache_*/openrouter_cache_*reads and profile gates exactly (including OpenRouter's TTL-support gate) — no acceptance invented beyond what each adapter honors today.
Resolution is biased high: when active settings disagree, the longest retention wins, since any longer-lived breakpoint keeps that prefix alive. CachePoint TTLs in history are deliberately not this method's job — they're already scanned by the history path, and settings vs. history stay separate concerns. The future unified cache setting (#7238) becomes one more input when it lands.
Ships first and standalone so #6337, #6534, and #6537 can consume it and drop their disclosed limitation.
Closes #6549
Checklist
- The issue on GitHub exists and is linked above.
- Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
- No breaking changes in accordance with the version policy.
- PR title is fit for the release changelog.