Skip to content

feat(ai): allowlist prompt_cache_key sending per provider - #49121

Merged
rekram1-node merged 4 commits into
v2from
prompt-cache-allowlist
Sep 15, 2026
Merged

rekram1-node merged 4 commits into
v2from
prompt-cache-allowlist

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Chat Completions omits prompt_cache_key unless compatibility.supportsPromptCacheKey is set (default off). Strict providers 400 on unknown body fields; header affinity (x-session-affinity, x-grok-conv-id) is unaffected.

  • New LanguageModelCompatibility flag (ai + schema structs).
  • Flag on for audited body-key packages: openai, azure, cerebras, deepinfra, fireworks, meta, moonshot, openrouter chat models. Mistral/Responses paths unchanged.
  • New PromptCacheKeyPlugin sets the flag for 12 catalog providers without AI packages (abliteration-ai, aihubmix, anyapi, auriko, edenai, jalapeno, llama, morph, snowflake-cortex, tencent-tokenhub, upstage, venice). Scoped-only support (fastrouter, frogbot) left off.
  • Tests: generic-compat asserts omit + flagged-model asserts send; xAI asserts header-only body.

Verified: ai typecheck + full suite (1385 pass), core typecheck + model-resolver tests, schema typecheck, oxlint clean.

@rekram1-node
rekram1-node enabled auto-merge (squash) September 15, 2026 06:23
@rekram1-node
rekram1-node merged commit 27aaa9c into v2 Sep 15, 2026
7 of 8 checks passed
@rekram1-node
rekram1-node deleted the prompt-cache-allowlist branch September 15, 2026 06:23
marwanvx added a commit to marwanvx/opencode that referenced this pull request Sep 18, 2026
Drop the provider/URL detection fallback in favor of upstream's
explicit per-provider mechanism (anomalyco#49121): the flag on the model
compatibility is the single gate, default off. Native OpenAI, Azure,
Cerebras, DeepInfra, Fireworks, Meta, Moonshot, and OpenRouter declare
it; everything else omits the body key. Detection-based tests for
OpenAI fixture, DeepSeek, and Zai are removed accordingly.
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant