GeezerVison is showing github.com — GPT-6.2: system prompt in top-level `instructions` is excluded from prompt caching · Issue #64550 · anomalyco/opencode
GPT-6.2: system prompt in top-level instructions is excluded from prompt caching #64550DescriptionDescription
GPT-6.2 intentionally excludes top-level instructions from prompt caching on the Responses API. OpenAI confirmed to us that this is a deliberate GPT-6.2 change: the Responses API now places top-level instructions at the end of the model's input and does not cache them, so repeating an identical request shows no cache writes or reads. For reusable prompts, OpenAI recommends putting the static text in the first developer message of input, ahead of the user message, where it can be cached.
OpenCode sends its system prompt as instructions, so every GPT-6.2 request pays the full input rate for it. In our review sessions that was 12,926 tokens per request, making GPT-6.2 Sol reviews 2.85 times the cost of identical GPT-6.1 Sol reviews, which cache the same instructions normally.
Code location: packages/ai/src/protocols/open-responses.ts, lowerConversation,
|
export const lowerConversation = Effect.fnUntraced(function* (request: LLMRequest, adapter: ProviderAdapter) { |
|
const instructions = ProviderShared.joinText(request.system) |
|
return { |
|
model: request.model.id, |
|
input: yield* lowerMessages(request, adapter), |
|
...(instructions ? { instructions } : {}), |
|
} |
.
Steps to reproduce
Send each request twice to /v1/responses (non-streaming, store: false, a 10.1k-token text with a unique prefix per pair, user input "Reply with the single word OK."):
| Model |
Text sent as |
1st request |
2nd request |
| gpt-6.2-sol |
instructions |
written 0, cached 0 |
written 0, cached 0 |
| gpt-6.2-sol |
developer message |
written 10,113 |
cached 10,113 |
| gpt-6.1-sol |
instructions |
written 10,114 |
cached 10,114 |
| gpt-6.1-sol |
developer message |
written 10,113 |
cached 10,113 |
Proposed fix
For GPT-6.2 and later, send the system prompt as a leading developer message instead of instructions, as OpenAI recommends. Earlier models can keep instructions, since they cache it.
OpenCode version
Dev build from 2026-11-13. The lowering is unchanged on dev at e92fbcf. Activityhcrosse commented on Nov 18, 2026 Already fixed by #64542 and #64544, which send the system prompt as a leading developer message on every Responses route. Closing as a duplicate. opencodejr commented on Nov 18, 2026 Thanks for the detailed report and measurements. I can reproduce this on 2.2.7 but not on the latest dev (de291ab), so it's probably already fixed. The fix should be in the next release.
What I checked: I ran opencode run with openai/gpt-6.2-sol against a local mock of the Responses endpoint and captured the request body. I didn't have a real OpenAI account, so I checked the request shape, not the cache numbers themselves.
- 2.2.7: the system prompt goes in top-level
instructions (about 10k characters) and input starts with the user message, as you described.
dev at de291ab: there is no instructions field. input starts with a developer message holding the system prompt, as OpenAI recommends. This comes from fix(ai): send the system prompt as a developer message on every Responses route #64544, which makes the change on every Responses route, not only OpenAI. On dev it applies to all models, not only GPT-6.2 and later.
I'm closing this issue now. If it still happens on a newer version, reply here and it will reopen.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|