Skip to content

[FEATURE]:Support GPT-5.6 prompt caching defaults #36318

Description

@AbdoKnbGit

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

OpenAI introduced new prompt caching behavior for GPT-5.6 and later models.

We should make opencode automatically use the right GPT-5.6 cache defaults while keeping GPT-5.5 and older models on the existing behavior.

Docs: https://developers.openai.com/api/docs/guides/prompt-caching

Why

GPT-5.6 uses prompt_cache_key for more reliable cache matching and supports request-wide cache options through prompt_cache_options.

The GPT-5.6 family includes multiple model ids, such as:

  • gpt-5.6
  • gpt-5.6-sol
  • gpt-5.6-terra
  • gpt-5.6-luna

There may also be provider or suffix variants like gpt-5.6-fast, so detection should match the whole gpt-5.6* family rather than only the exact gpt-5.6 id.

Desired behavior

For GPT-5.6 family OpenAI models, opencode should send:

promptCacheOptions: {
  mode: "implicit",
  ttl: "30m"
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions