[GH-ISSUE #8275] OpenAI and ChatGPT (Codex) connections get no prompt cache hits #8214

Closed
opened 2026-10-26 04:03:23 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8275

Originally assigned to: @kolacheee on GitHub.

On an OpenAI-through-ChatGPT (Codex login) connection, two consecutive Game Master turns reported 0 cached tokens and 0 cache writes (about 18.5k and 18.9k prompt tokens), even though the first ~7k tokens of both prompts were byte-identical.

Cause: Marinara never sends prompt_cache_key. OpenAI uses that key to send requests to the machine that already holds a prompt's prefix, and Codex CLI sends one for each conversation. Without the key, the turns of one chat land on different machines.

Expected: every request in a chat carries the same prompt_cache_key, on chat completions and on the Responses API, but only for OpenAI's own endpoints, since a compatible endpoint may reject a field it doesn't know. Debug mode should also log the provider's raw usage object and the Responses request body as sent, so the next cache miss can be diagnosed from the log.

Originally created by @kolacheee on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8275 Originally assigned to: @kolacheee on GitHub. On an OpenAI-through-ChatGPT (Codex login) connection, two consecutive Game Master turns reported 0 cached tokens and 0 cache writes (about 18.5k and 18.9k prompt tokens), even though the first ~7k tokens of both prompts were byte-identical. Cause: Marinara never sends `prompt_cache_key`. OpenAI uses that key to send requests to the machine that already holds a prompt's prefix, and Codex CLI sends one for each conversation. Without the key, the turns of one chat land on different machines. Expected: every request in a chat carries the same `prompt_cache_key`, on chat completions and on the Responses API, but only for OpenAI's own endpoints, since a compatible endpoint may reject a field it doesn't know. Debug mode should also log the provider's raw usage object and the Responses request body as sent, so the next cache miss can be diagnosed from the log.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8214
No description provided.