diff --git a/apps/web/src/lib/ai-gateway/kilo-auto/index.ts b/apps/web/src/lib/ai-gateway/kilo-auto/index.ts index 16391a37a5..e4c9717699 100644 --- a/apps/web/src/lib/ai-gateway/kilo-auto/index.ts +++ b/apps/web/src/lib/ai-gateway/kilo-auto/index.ts @@ -5,7 +5,7 @@ import { CLAUDE_SONNET_CURRENT_MODEL_ID, } from '@/lib/ai-gateway/providers/anthropic.constants'; import type { OpenRouterReasoningConfig } from '@/lib/ai-gateway/providers/openrouter/types'; -import type { ModelSettings, OpenCodeSettings, Verbosity } from '@kilocode/db/schema-types'; +import type { OpenCodeSettings, Verbosity } from '@kilocode/db/schema-types'; import { qwen36_plus_model } from '@/lib/ai-gateway/providers/qwen'; type AutoModel = { @@ -19,7 +19,6 @@ type AutoModel = { input_cache_read_price: string | undefined; input_cache_write_price: string | undefined; supports_images: boolean; - roocode_settings: ModelSettings | undefined; opencode_settings: OpenCodeSettings | undefined; }; @@ -110,7 +109,6 @@ export const KILO_AUTO_FRONTIER_MODEL: AutoModel = { input_cache_read_price: '0.0000005', input_cache_write_price: '0.00000625', supports_images: true, - roocode_settings: undefined, opencode_settings: { family: 'claude', prompt: 'anthropic', @@ -129,7 +127,6 @@ export const KILO_AUTO_FREE_MODEL: AutoModel = { input_cache_read_price: '0', input_cache_write_price: '0', supports_images: false, - roocode_settings: undefined, opencode_settings: undefined, }; @@ -144,7 +141,6 @@ export const KILO_AUTO_BALANCED_MODEL: AutoModel = { input_cache_read_price: '0.0000000325', input_cache_write_price: '0.00000040625', supports_images: true, - roocode_settings: undefined, opencode_settings: { ai_sdk_provider: 'openai-compatible', }, @@ -161,7 +157,6 @@ export const KILO_AUTO_SMALL_MODEL: AutoModel = { input_cache_read_price: '0.000000005', input_cache_write_price: undefined, supports_images: true, - roocode_settings: undefined, opencode_settings: undefined, }; diff --git a/apps/web/src/lib/ai-gateway/providers/model-settings.ts b/apps/web/src/lib/ai-gateway/providers/model-settings.ts index 024578fdc8..5b381f4193 100644 --- a/apps/web/src/lib/ai-gateway/providers/model-settings.ts +++ b/apps/web/src/lib/ai-gateway/providers/model-settings.ts @@ -1,6 +1,5 @@ import { seed_20_pro_free_model } from '@/lib/ai-gateway/providers/bytedance'; -import { isGemini3Model, isGeminiModel, isGemmaModel } from '@/lib/ai-gateway/providers/google'; -import { isMinimaxModel } from '@/lib/ai-gateway/providers/minimax'; +import { isGemini3Model, isGemmaModel } from '@/lib/ai-gateway/providers/google'; import { isMoonshotModel } from '@/lib/ai-gateway/providers/moonshotai'; import { isOpenAiModel } from '@/lib/ai-gateway/providers/openai'; import { qwen36_plus_model } from '@/lib/ai-gateway/providers/qwen'; @@ -8,41 +7,11 @@ import { isXaiModel } from '@/lib/ai-gateway/providers/xai'; import { isZaiModel } from '@/lib/ai-gateway/providers/zai'; import type { CustomLlmProvider, - ModelSettings, OpenClawModelSettings, OpenCodeSettings, - VersionedSettings, } from '@kilocode/db/schema-types'; import { ReasoningEffortSchema } from '@kilocode/db/schema-types'; -export function getModelSettings(model: string): ModelSettings | undefined { - if (isOpenAiModel(model)) { - return { - included_tools: ['apply_patch'], - excluded_tools: ['apply_diff', 'delete_file', 'edit_file', 'write_to_file'], - }; - } - if (isMinimaxModel(model)) { - return { - included_tools: ['search_and_replace'], - excluded_tools: ['apply_diff', 'edit_file'], - }; - } - return undefined; -} - -export function getVersionedModelSettings(model: string): VersionedSettings | undefined { - if (isGeminiModel(model) || isZaiModel(model)) { - return { - '4.146.0': { - included_tools: ['write_file', 'edit_file'], - excluded_tools: ['apply_diff'], - }, - }; - } - return undefined; -} - export const REASONING_VARIANTS_BINARY = { instant: { reasoning: { enabled: false, effort: 'none' } }, thinking: { reasoning: { enabled: true, effort: 'medium' } }, diff --git a/apps/web/src/lib/ai-gateway/providers/openrouter/index.ts b/apps/web/src/lib/ai-gateway/providers/openrouter/index.ts index 7076f27ec5..23a203f30c 100644 --- a/apps/web/src/lib/ai-gateway/providers/openrouter/index.ts +++ b/apps/web/src/lib/ai-gateway/providers/openrouter/index.ts @@ -10,10 +10,8 @@ import { captureException, captureMessage } from '@sentry/nextjs'; import { convertFromKiloExclusiveModel } from '@/lib/ai-gateway/providers/kilo-exclusive-model'; import { isForbiddenFreeModel } from '@/lib/ai-gateway/forbidden-free-models'; import { - getModelSettings, getOpenClawSettings, getOpenCodeSettings, - getVersionedModelSettings, } from '@/lib/ai-gateway/providers/model-settings'; import { AUTO_MODELS } from '@/lib/ai-gateway/kilo-auto'; @@ -48,7 +46,6 @@ function buildAutoModels(): OpenRouterModel[] { }, context_length: m.context_length, supported_parameters: ['max_tokens', 'temperature', 'tools', 'reasoning', 'include_reasoning'], - settings: m.roocode_settings, opencode: m.opencode_settings, })); } @@ -76,8 +73,6 @@ function enhancedModelList(models: OpenRouterModel[]) { name: skipSuffix ? model.name : isNew ? model.name + ' (new)' : model.name, preferredIndex: preferredIndex >= 0 ? preferredIndex : undefined, isFree: isFreeModel(model.id), - settings: model.settings ?? getModelSettings(model.id), - versioned_settings: model.versioned_settings ?? getVersionedModelSettings(model.id), opencode: model.opencode ?? getOpenCodeSettings(model.id), openclaw: model.openclaw ?? getOpenClawSettings(model.id), }; diff --git a/apps/web/src/lib/organizations/organization-types.ts b/apps/web/src/lib/organizations/organization-types.ts index 6114888aaf..5b8bb644d3 100644 --- a/apps/web/src/lib/organizations/organization-types.ts +++ b/apps/web/src/lib/organizations/organization-types.ts @@ -19,12 +19,7 @@ export { import type { OrganizationRole, OrganizationPlan } from './organization-base-types'; import { OrganizationPlanSchema, OrganizationSettingsSchema } from './organization-base-types'; -import { - ModelSettingsSchema, - OpenClawModelSettingsSchema, - OpenCodeSettingsSchema, - VersionedSettingsSchema, -} from '@kilocode/db/schema-types'; +import { OpenClawModelSettingsSchema, OpenCodeSettingsSchema } from '@kilocode/db/schema-types'; // API-facing billing cycle values: 'monthly' | 'annual' // The DB stores 'yearly' instead of 'annual'; Stripe uses 'year'/'month'. @@ -204,8 +199,6 @@ const OpenRouterModelSchema = z.object({ // kilocode additions: preferredIndex: z.number().optional(), isFree: z.boolean().optional(), - settings: ModelSettingsSchema.optional(), - versioned_settings: VersionedSettingsSchema.optional(), opencode: OpenCodeSettingsSchema.optional(), openclaw: OpenClawModelSettingsSchema.optional(), diff --git a/apps/web/src/scripts/roo-tool-settings.ts b/apps/web/src/scripts/roo-tool-settings.ts deleted file mode 100644 index e4da21661b..0000000000 --- a/apps/web/src/scripts/roo-tool-settings.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as z from 'zod'; -import yaml from 'js-yaml'; - -const settingsSchema = z.object({ - includedTools: z.array(z.string()).optional(), - excludedTools: z.array(z.string()).optional(), -}); - -const responseSchema = z.object({ - data: z.array( - z.object({ - name: z.string(), - deprecated: z.boolean().optional(), - settings: z.object({}).optional(), - versionedSettings: z.record(z.string(), settingsSchema).optional(), - }) - ), -}); - -async function main() { - const rawResponse = await fetch('https://api.roocode.com/proxy/v1/models'); - const parsedResponse = responseSchema.parse(await rawResponse.json()); - console.log(yaml.dump(parsedResponse.data.filter(d => !d.deprecated))); -} - -main().catch(console.error); diff --git a/packages/db/src/schema-types.ts b/packages/db/src/schema-types.ts index ef1c229cdd..8fbf5008c0 100644 --- a/packages/db/src/schema-types.ts +++ b/packages/db/src/schema-types.ts @@ -681,34 +681,6 @@ export const NormalizedOpenRouterResponse = z.object({ generated_at: z.string(), }); -// --- Model settings --- - -export const ToolSchema = z.enum([ - 'apply_diff', - 'apply_patch', - 'delete_file', - 'edit_file', - 'search_replace', - 'search_and_replace', - 'write_file', - 'write_to_file', -]); - -export type Tool = z.infer; - -export const ToolArraySchema = z.array(ToolSchema); - -export const ModelSettingsSchema = z.object({ - included_tools: ToolArraySchema, - excluded_tools: ToolArraySchema, -}); - -export type ModelSettings = z.infer; - -export const VersionedSettingsSchema = z.record(z.string(), ModelSettingsSchema); - -export type VersionedSettings = z.infer; - export const OpenCodePromptSchema = z.enum([ 'codex', 'gemini',