Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/kilo-gateway/src/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ export async function fetchKiloModels(options?: {
const models: Record<string, any> = {}

for (const model of raw.data) {
// Skip models that don't support tools — Kilo requires tool calling
if (!model.supported_parameters?.includes("tools")) {
// Skip models that explicitly don't support tools — Kilo requires tool calling
// Optimistically assume models with a missing supported_parameters array support tools
if (model.supported_parameters && !model.supported_parameters.includes("tools")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: tool_call still resolves to false for optimistically-included models

This filter now lets models with a missing supported_parameters array through, but transformToModelDevFormat (models.ts:216) does const supportedParameters = model.supported_parameters || [], then supportsTools = supportedParameters.includes("tools") (models.ts:226). For a model with no supported_parameters, that evaluates to [], so supportsTools is false and the resulting model gets tool_call: false — directly contradicting the stated intent of "optimistically assume ... support tools". Consumers that gate tool usage on tool_call will still treat these models as non-tool-capable, so the fix doesn't fully achieve its goal. Consider deriving supportsTools the same way as this filter, e.g. !model.supported_parameters || supportedParameters.includes("tools").


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't seem to matter

continue
}

Expand Down Expand Up @@ -222,7 +223,7 @@ function transformToModelDevFormat(model: OpenRouterModel): any {

// Determine capabilities
const supportsImages = inputModalities.includes("image")
const supportsTools = supportedParameters.includes("tools")
const supportsTools = !model.supported_parameters || supportedParameters.includes("tools")
const supportsReasoning = supportedParameters.includes("reasoning")
const supportsTemperature = supportedParameters.includes("temperature")

Expand Down
Loading