[Bug] openai-codex: reflect tool loop gets 0 cached tokens despite a stable per-run prompt_cache_key
Version: stock 1.2.1 (Docker), provider openai-codex, model gpt-6-luna, reasoning effort low, store: false.
Observed (llm_requests, operation reflect): every hour from 2026-11-14 01:00Z to 2026-11-15 01:30Z, 803 calls with cached_tokens = 0 (one hit in total), about 4.2 calls and 137k input tokens per trace. On the same deployment, route and account, consolidation caches about 33% and refresh_mental_model about 38%. In one earlier 9-hour window (2026-11-13 16:00Z-2026-11-14 00:59Z), when the reflect decision model was enabled, reflect on openai-codex cached 67-88%.
Already ruled out: the cache key. codex_llm._prompt_cache_key sends cache_affinity_id(trace_id) as prompt_cache_key and as the session-id header, which stays the same across one reflect run. Stored request previews for one bank share a few prefixes (10 distinct prefixes over 803 calls).
Suspected, not proven: something in the per-turn request makes each step's prefix differ from the previous step's, so a step can never reuse the step before it. Candidates: the per-turn response schema (llm_info.request.response_schema alternates next_call / done, related to #6422 on openai-compatible), or the fresh trailing user turn each step adds.
Expected: steps 2..n of one reflect run reuse the prefix of step 1, as consolidation does on the same route.
Related: #6422, #6357, #6563.