mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(provider): add CLAUDE_CODE_AUTO_COMPACT_WINDOW for Kimi For Coding preset (#4401)
Set the default Claude Code auto-compact window to 262144 for the Kimi For Coding provider preset, matching the official Kimi docs: https://www.kimi.com/code/docs/en/third-party-tools/other-coding-agents.html Use templateValues so users can customize the value (e.g. for future models or performance tuning) while keeping 262144 as the default.
This commit is contained in:
@@ -392,6 +392,15 @@ export const providerPresets: ProviderPreset[] = [
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://api.kimi.com/coding/",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
CLAUDE_CODE_AUTO_COMPACT_WINDOW: "${CLAUDE_CODE_AUTO_COMPACT_WINDOW}",
|
||||
},
|
||||
},
|
||||
templateValues: {
|
||||
CLAUDE_CODE_AUTO_COMPACT_WINDOW: {
|
||||
label: "Auto Compact Window",
|
||||
placeholder: "262144",
|
||||
defaultValue: "262144",
|
||||
editorValue: "262144",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
|
||||
@@ -1,6 +1,33 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { providerPresets } from "@/config/claudeProviderPresets";
|
||||
|
||||
describe("Kimi For Coding Provider Preset", () => {
|
||||
const kimiForCoding = providerPresets.find(
|
||||
(p) => p.name === "Kimi For Coding",
|
||||
);
|
||||
|
||||
it("should include Kimi For Coding preset", () => {
|
||||
expect(kimiForCoding).toBeDefined();
|
||||
});
|
||||
|
||||
it("should use template placeholder for Claude Code auto-compact window", () => {
|
||||
const env = (kimiForCoding!.settingsConfig as any).env;
|
||||
expect(env).toHaveProperty(
|
||||
"CLAUDE_CODE_AUTO_COMPACT_WINDOW",
|
||||
"${CLAUDE_CODE_AUTO_COMPACT_WINDOW}",
|
||||
);
|
||||
});
|
||||
|
||||
it("should expose auto-compact window as editable template value with Kimi default", () => {
|
||||
const values = (kimiForCoding!.templateValues as any)
|
||||
?.CLAUDE_CODE_AUTO_COMPACT_WINDOW;
|
||||
expect(values).toBeDefined();
|
||||
expect(values.defaultValue).toBe("262144");
|
||||
expect(values.editorValue).toBe("262144");
|
||||
expect(values.label).toBe("Auto Compact Window");
|
||||
});
|
||||
});
|
||||
|
||||
describe("AWS Bedrock Provider Presets", () => {
|
||||
const bedrockAksk = providerPresets.find(
|
||||
(p) => p.name === "AWS Bedrock (AKSK)",
|
||||
|
||||
Reference in New Issue
Block a user