Skip to content

Commit bc50b59

Browse files
sahrizviHaiderclaude
authored
fix: [AI-6622] enable cache_control trigger for altimate-backend provider (#850)
Adds `model.providerID === "altimate-backend"` to the cache-control gating condition in `ProviderTransform.message()` so messages routed through the Altimate Gateway get `cache_control: ephemeral` markers stamped on the last content block. Required for the gateway's Anthropic-fallback path: when Azure GPT-5.5 errors, litellm falls back to Anthropic Sonnet 4.6, which honors these markers; without them, the fallback calls would not cache. For the Azure-primary path: Azure ignores `cache_control` markers (it uses automatic prefix-based caching), so stamping them is a no-op there. The companion backend change extracts `prompt_tokens_details.cached_tokens` from the response and surfaces it back to clients so cache rates and per-session cost become visible. Companion backend change on `altimate-backend` branch `fix/AI-6622-llm-cache-plumbing`. Both repos pair together. Full RCA + investigation journey: `~/Documents/altimate-deliverables/AI-6622-*.md`. Co-authored-by: Haider <haider@altimate.ai> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 56259a3 commit bc50b59

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/opencode/src/provider/transform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ export namespace ProviderTransform {
284284
if (
285285
(model.providerID === "anthropic" ||
286286
model.providerID === "google-vertex-anthropic" ||
287+
model.providerID === "altimate-backend" ||
287288
model.api.id.includes("anthropic") ||
288289
model.api.id.includes("claude") ||
289290
model.id.includes("anthropic") ||

0 commit comments

Comments
 (0)