Skip to content

The open source coding agent.

TypeScript

fix openrouter caching

Dax Raad6465c9c44ac6
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts
index 433e9f414cc..a6a9322f5ad 100644
--- a/packages/opencode/src/provider/transform.ts
+++ b/packages/opencode/src/provider/transform.ts
@@ -13,22 +13,15 @@ export namespace ProviderTransform {
anthropic: {
cacheControl: { type: "ephemeral" },
},
- openaiCompatible: {
+ openrouter: {
cache_control: { type: "ephemeral" },
},
- }
- }
- }
- if (providerID === "amazon-bedrock" || modelID.includes("anthropic")) {
- const system = msgs.filter((msg) => msg.role === "system").slice(0, 2)
- const final = msgs.filter((msg) => msg.role !== "system").slice(-2)
-
- for (const msg of unique([...system, ...final])) {
- msg.providerOptions = {
- ...msg.providerOptions,
bedrock: {
cachePoint: { type: "ephemeral" },
},
+ openaiCompatible: {
+ cache_control: { type: "ephemeral" },
+ },
}
}
}