Skip to content

Kilo Code CLI Bug: Empty model field in API requests #3323

@JMogiel

Description

@JMogiel

Plugin Type

Kilo Code CLI

App Version

0.0.10

Description

Kilo Code CLI Bug Report: Empty model field in API requests

Summary

Kilo Code CLI (v4.110.0) does not send the model field in /v1/chat/completions API requests when using the openai provider with a custom openAiBaseUrl, despite having apiModelId properly configured. This causes API requests to fail with 404 errors.

VS Code Extension works correctly with the same configuration, sending the model field as expected.

Environment

  • Kilo Code CLI: v0.0.10
  • Kilo Code VS Code Extension: v4.110.0
  • Provider: openai with custom base URL
  • Custom API endpoint: XXX

Configuration

{
  "version": "1.0.0",
  "mode": "architect",
  "provider": "1",
  "providers": [
    {
      "id": "1",
      "provider": "openai",
      "openAiApiKey": "skdummy-key-12345",
      "apiModelId": “GPT-5,
      "openAiBaseUrl": “XXX”
    }
  ]
}

Expected Behavior

CLI should send the model field in the request body:

{
  "model": “GPT-5”,
  "messages": [...],
  ...
}

Actual Behavior

CLI sends empty model field in the request body:

{
  "model": "",
  "messages": [...],
  ...
}

Debug Logs Comparison

VS Code Extension (WORKING)

[2025-10-25T19:07:12.985+02:00] REQUEST TO LLM
[2025-10-25T19:07:12.986+02:00] Model: GPT-5

[2025-10-25T19:07:13.288+02:00] REQUEST HEADERS
{
  "authorization": "Bearer .",
  "x-kilocode-version": "4.110.0",
  "user-agent": "Kilo-Code/4.110.0",
  "x-stainless-runtime-version": "v22.19.0",
  ...
}

[2025-10-25T19:07:33.063+02:00] UPSTREAM RESPONSE STATUS: 200

CLI (NOT WORKING)

[2025-10-25T19:08:56.047+02:00] REQUEST TO LLM
[2025-10-25T19:08:56.047+02:00] Model:

[2025-10-25T19:08:56.078+02:00] REQUEST HEADERS
{
  "authorization": "Bearer ..........",
  "x-kilocode-version": "4.110.0",
  "user-agent": "Kilo-Code/4.110.0",
  "x-stainless-runtime-version": "v24.1.0",
  ...
}

[2025-10-25T19:08:56.895+02:00] UPSTREAM RESPONSE STATUS: 404
[2025-10-25T19:08:56.896+02:00] ERROR: {
  "code": "NotAuthorizedOrNotFound",
  "message": "Unknown resource Incorrect override model or user doesn't have sufficient permissions"
}

Key Differences

  1. Model field:

    • Extension: Model: GPT-5
    • CLI: Model: (empty) ❌
  2. Node version:

    • Extension: v22.19.0
    • CLI: v24.1.0
  3. Authorization:

    • Extension: Bearer . (1 dot)
    • CLI: Bearer .......... (10 dots)
    • Note: Both are placeholders and work correctly (proxy replaces with real token)

Tested Configurations

All failed with CLI (but work with Extension):

  • provider: "openai" with openAiBaseUrl
  • provider: "openai-native" with openAiNativeBaseUrl
  • Different modes (architect, code) ❌
  • Different API key lengths (10, 15, 30 characters) ❌

Workaround

Added fallback in the proxy server (XXX) to handle empty model:

// In upstream adapter
if (!req.body.model || req.body.model.trim() === '') {
  const fallbackModel = process.env.DEFAULT_MODEL || ‘GPT-5
  console.log(`Empty model received, using fallback: ${fallbackModel}`)
  req.body.model = fallbackModel
}

Related Issues

This may be related to:

Additional Context

  • The bug only affects CLI, not VS Code Extension
  • Both use the same configuration file format and provider
  • The bug is reproducible with latest CLI version (v0.0.10)
  • Tested on macOS (Darwin 24.6.0)

Expected Fix

CLI should read and send the apiModelId from provider configuration in the model field of API requests, matching the behavior of the VS Code Extension.

Reproduction steps

Reproduction Steps

  1. Configure kilo code CLI with openai provider and custom base URL
  2. Set apiModelId to any valid model name (e.g., GPT-5)
  3. Run kilo code CLI and send a chat request
  4. Observe API logs showing empty model field in request body

Provider

Custom

Model

GPT-5

System Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIKilo Code CLI

    Type

    Projects

    Status

    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions