feat(coding-agent,tui): add stacked autocomplete providers closes #2983

This commit is contained in:
Mario Zechner
2026-04-22 15:44:08 +02:00
parent 4e919868f6
commit 8234ebf9ee
16 changed files with 465 additions and 33 deletions

View File

@@ -126,9 +126,27 @@ describe("openai-completions cacheControlFormat", () => {
mockState.lastParams = undefined;
});
it("applies Anthropic-style cache markers for built-in opencode-go Qwen models", async () => {
const model = getModel("opencode-go", "qwen3.5-plus");
expect(model.compat?.cacheControlFormat).toBe("anthropic");
it("applies Anthropic-style cache markers when model compat enables them", async () => {
const model: Model<"openai-completions"> = {
id: "custom-qwen",
name: "Custom Qwen",
api: "openai-completions",
provider: "openrouter",
baseUrl: "https://example.com/v1",
reasoning: true,
input: ["text"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 128000,
maxTokens: 32000,
compat: {
cacheControlFormat: "anthropic",
},
};
const params = await capturePayload(model);
expectAnthropicCacheMarkers(params);
@@ -141,7 +159,26 @@ describe("openai-completions cacheControlFormat", () => {
});
it("omits Anthropic-style cache markers when cacheRetention is none", async () => {
const model = getModel("opencode-go", "qwen3.5-plus");
const model: Model<"openai-completions"> = {
id: "custom-qwen",
name: "Custom Qwen",
api: "openai-completions",
provider: "openrouter",
baseUrl: "https://example.com/v1",
reasoning: true,
input: ["text"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 128000,
maxTokens: 32000,
compat: {
cacheControlFormat: "anthropic",
},
};
const params = await capturePayload(model, { cacheRetention: "none" });
const instructionMessage = getInstructionMessage(params);