-
Couldn't load subscription status.
- Fork 1.2k
Description
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:
openaiwith 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
-
Model field:
- Extension:
Model: GPT-5✅ - CLI:
Model:(empty) ❌
- Extension:
-
Node version:
- Extension: v22.19.0
- CLI: v24.1.0
-
Authorization:
- Extension:
Bearer .(1 dot) - CLI:
Bearer ..........(10 dots) - Note: Both are placeholders and work correctly (proxy replaces with real token)
- Extension:
Tested Configurations
All failed with CLI (but work with Extension):
provider: "openai"withopenAiBaseUrl❌provider: "openai-native"withopenAiNativeBaseUrl❌- 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:
- The API provider of OpenAI with custom base url use wrong response path #2384 - "The API provider of OpenAI with custom base url use wrong response path"
- [OpenAI Compatible] Base URL field incorrectly appends /chat/completions to full endpoint URLs #2035 - "[OpenAI Compatible] Base URL field incorrectly appends /chat/completions to full endpoint URLs"
- Support for LiteLLM seems buggy #1866 - "Support for LiteLLM seems buggy"
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
- Configure kilo code CLI with
openaiprovider and custom base URL - Set
apiModelIdto any valid model name (e.g.,GPT-5) - Run kilo code CLI and send a chat request
- Observe API logs showing empty
modelfield in request body
Provider
Custom
Model
GPT-5
System Information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status