fix(providers): make all models available in kilocode provider (#32352)

* kilocode: dynamic model discovery, kilo/auto default, cooldown exemption

- Replace 9-model hardcoded catalog with dynamic discovery from
  GET /api/gateway/models (Venice-like pattern with static fallback)
- Default model changed from anthropic/claude-opus-4.6 to kilo/auto
  (smart routing model)
- Add createKilocodeWrapper for X-KILOCODE-FEATURE header injection
  and reasoning.effort handling (skip for kilo/auto)
- Add kilocode to cooldown-exempt providers (proxy like OpenRouter)
- Keep sync buildKilocodeProvider for onboarding, add async
  buildKilocodeProviderWithDiscovery for implicit provider resolution
- Per-token gateway pricing converted to per-1M-token for cost fields

* kilocode: skip reasoning injection for x-ai models, harden discovery loop

* fix(kilocode): keep valid discovered duplicates (openclaw#32352, thanks @pandemicsyn)

* refactor(proxy): normalize reasoning payload guards (openclaw#32352, thanks @pandemicsyn)

* chore(changelog): note kilocode hardening (openclaw#32352, thanks @pandemicsyn and @vincentkoc)

* chore(changelog): fix kilocode note format (openclaw#32352, thanks @pandemicsyn and @vincentkoc)

* test(kilocode): support auto-model override cases (openclaw#32352, thanks @pandemicsyn)

* Update CHANGELOG.md

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
Florian Hines
2026-03-07 10:14:06 -06:00
committed by GitHub
parent 786ec21b5a
commit 33e7394861
15 changed files with 832 additions and 168 deletions

View File

@@ -1,7 +1,7 @@
export const KILOCODE_BASE_URL = "https://api.kilo.ai/api/gateway/";
export const KILOCODE_DEFAULT_MODEL_ID = "anthropic/claude-opus-4.6";
export const KILOCODE_DEFAULT_MODEL_ID = "kilo/auto";
export const KILOCODE_DEFAULT_MODEL_REF = `kilocode/${KILOCODE_DEFAULT_MODEL_ID}`;
export const KILOCODE_DEFAULT_MODEL_NAME = "Claude Opus 4.6";
export const KILOCODE_DEFAULT_MODEL_NAME = "Kilo Auto";
export type KilocodeModelCatalogEntry = {
id: string;
name: string;
@@ -10,6 +10,12 @@ export type KilocodeModelCatalogEntry = {
contextWindow?: number;
maxTokens?: number;
};
/**
* Static fallback catalog — used by the sync onboarding path and as a
* fallback when dynamic model discovery from the gateway API fails.
* The full model list is fetched dynamically by {@link discoverKilocodeModels}
* in `src/agents/kilocode-models.ts`.
*/
export const KILOCODE_MODEL_CATALOG: KilocodeModelCatalogEntry[] = [
{
id: KILOCODE_DEFAULT_MODEL_ID,
@@ -19,70 +25,6 @@ export const KILOCODE_MODEL_CATALOG: KilocodeModelCatalogEntry[] = [
contextWindow: 1000000,
maxTokens: 128000,
},
{
id: "z-ai/glm-5:free",
name: "GLM-5 (Free)",
reasoning: true,
input: ["text"],
contextWindow: 202800,
maxTokens: 131072,
},
{
id: "minimax/minimax-m2.5:free",
name: "MiniMax M2.5 (Free)",
reasoning: true,
input: ["text"],
contextWindow: 204800,
maxTokens: 131072,
},
{
id: "anthropic/claude-sonnet-4.5",
name: "Claude Sonnet 4.5",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 64000,
},
{
id: "openai/gpt-5.2",
name: "GPT-5.2",
reasoning: true,
input: ["text", "image"],
contextWindow: 400000,
maxTokens: 128000,
},
{
id: "google/gemini-3-pro-preview",
name: "Gemini 3 Pro Preview",
reasoning: true,
input: ["text", "image"],
contextWindow: 1048576,
maxTokens: 65536,
},
{
id: "google/gemini-3-flash-preview",
name: "Gemini 3 Flash Preview",
reasoning: true,
input: ["text", "image"],
contextWindow: 1048576,
maxTokens: 65535,
},
{
id: "x-ai/grok-code-fast-1",
name: "Grok Code Fast 1",
reasoning: true,
input: ["text"],
contextWindow: 256000,
maxTokens: 10000,
},
{
id: "moonshotai/kimi-k2.5",
name: "Kimi K2.5",
reasoning: true,
input: ["text", "image"],
contextWindow: 262144,
maxTokens: 65535,
},
];
export const KILOCODE_DEFAULT_CONTEXT_WINDOW = 1000000;
export const KILOCODE_DEFAULT_MAX_TOKENS = 128000;