fix(ai,coding-agent): support anthropic-style cache control for openai compatibles closes #3392

This commit is contained in:
Mario Zechner
2026-04-20 17:12:05 +02:00
parent 4b2caf43a8
commit 3054fd7a3b
13 changed files with 326 additions and 71 deletions

View File

@@ -374,7 +374,7 @@ describe("ModelRegistry", () => {
}
});
test("compat schema accepts reasoningEffortMap and supportsStrictMode", () => {
test("compat schema accepts reasoningEffortMap, supportsStrictMode, and cacheControlFormat", () => {
writeRawModelsJson({
demo: {
baseUrl: "https://example.com/v1",
@@ -394,6 +394,7 @@ describe("ModelRegistry", () => {
high: "max",
},
supportsStrictMode: false,
cacheControlFormat: "anthropic",
},
},
],
@@ -406,6 +407,7 @@ describe("ModelRegistry", () => {
expect(registry.getError()).toBeUndefined();
expect(compat?.reasoningEffortMap).toEqual({ minimal: "default", high: "max" });
expect(compat?.supportsStrictMode).toBe(false);
expect(compat?.cacheControlFormat).toBe("anthropic");
});
test("model-level baseUrl overrides provider-level baseUrl for custom models", () => {