Files
openclaw/extensions/kimi-coding/provider-policy-api.ts
Peter Steinberger 2409df768c fix(kimi): honor K3 thinking off (#109335)
* fix(kimi): honor K3 thinking off

* chore: defer Kimi release note

* test(kimi): narrow live reasoning blocks
2026-07-16 13:50:15 -07:00

36 lines
944 B
TypeScript

// Kimi Code policy module exposes model-specific thinking controls before runtime registration.
import type {
ProviderDefaultThinkingPolicyContext,
ProviderThinkingProfile,
} from "openclaw/plugin-sdk/plugin-entry";
export const KIMI_K3_MODEL_IDS = ["k3", "k3[1m]"] as const;
export function isKimiK3ModelId(modelId: string): boolean {
return KIMI_K3_MODEL_IDS.includes(
modelId.trim().toLowerCase() as (typeof KIMI_K3_MODEL_IDS)[number],
);
}
export function resolveThinkingProfile({
modelId,
}: ProviderDefaultThinkingPolicyContext): ProviderThinkingProfile {
if (isKimiK3ModelId(modelId)) {
return {
levels: [
{ id: "off", label: "off" },
{ id: "max", label: "max" },
],
defaultLevel: "max",
preserveWhenCatalogReasoningFalse: true,
};
}
return {
levels: [
{ id: "off", label: "off" },
{ id: "low", label: "on" },
],
defaultLevel: "off",
};
}