Add per-turn prompt cache TTL options (#59480)

## What changed

- Expose `PromptCacheTtl` through `TurnStartOptions` and `RecoverTurnRequest`, supporting `30m` and `12h` minimum cache lifetimes.
- Carry the selected TTL through turn execution and compaction into `prompt_cache_options.ttl` on Responses HTTP and WebSocket requests. Omit the field when unset and keep the selection scoped to the turn.
- Include prompt cache options in WebSocket request reuse checks.

## Testing

Add coverage for both TTL values and omission on a subsequent turn without an override, and extend WebSocket serialization coverage to include prompt cache options.

GitOrigin-RevId: 8529306e6ad6030fe77c5e6bf19f3810717c0c5e
This commit is contained in:
Rohan Mehta
2026-11-04 19:58:24 +00:00
committed by copyberry
parent c9296fa1a9
commit 41cbd5b9b2
26 changed files with 106 additions and 0 deletions
+2
View File
@@ -609,9 +609,11 @@ impl CodexThread {
turn_id,
thread_settings,
trace,
prompt_cache_ttl,
cyber_access_program,
} = request;
let start_options = TurnStartOptions {
prompt_cache_ttl,
cyber_access_program,
..self.session.recovered_turn_start_options(&turn_id).await
};