kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

Failed to switch API configuration for the `VS Code LM API` provider

Open euxx opened this issue 4 months ago • 3 comments

Description

Kilo Code v4.84.0 adds model switching to the VS Code LM API provider in the bottom main panel, but it raises a Failed to create API configuration error when switching models. And the displayed selected model is incorrect.

Provider Profile: Image

Switch Model: Image

Raise Error: Image

Kilo Code v4.84.1 still have this error.

euxx avatar Aug 27 '25 04:08 euxx

Raw error message:

Error create new api configuration: {
  "stack": "Error: Failed to save config: [\n  {\n    \"code\": \"invalid_type\",\n    \"expected\": \"object\",\n    \"received\": \"string\",\n    \"path\": [\n      \"vsCodeLmModelSelector\"\n    ],\n    \"message\": \"Expected object, received string\"\n  }\n]\n    at t.saveConfig (/Users/e/.vscode/extensions/kilocode.kilo-code-4.84.1/core/config/ProviderSettingsManager.ts:327:10)\n    at t.upsertProviderProfile (/Users/e/.vscode/extensions/kilocode.kilo-code-4.84.1/core/webview/ClineProvider.ts:1190:15)\n    at Qvr (/Users/e/.vscode/extensions/kilocode.kilo-code-4.84.1/core/webview/webviewMessageHandler.ts:1681:5)",
  "message": "Failed to save config: [\n  {\n    \"code\": \"invalid_type\",\n    \"expected\": \"object\",\n    \"received\": \"string\",\n    \"path\": [\n      \"vsCodeLmModelSelector\"\n    ],\n    \"message\": \"Expected object, received string\"\n  }\n]"
}

Formated error message:

{
  "stack": "Error: Failed to save config: [\n  {\n    \"code\": \"invalid_type\",\n    \"expected\": \"object\",\n    \"received\": \"string\",\n    \"path\": [\n      \"vsCodeLmModelSelector\"\n    ],\n    \"message\": \"Expected object, received string\"\n  }\n]\n    at t.saveConfig (/Users/e/.vscode/extensions/kilocode.kilo-code-4.84.1/core/config/ProviderSettingsManager.ts:327:10)\n    at t.upsertProviderProfile (/Users/e/.vscode/extensions/kilocode.kilo-code-4.84.1/core/webview/ClineProvider.ts:1190:15)\n    at Qvr (/Users/e/.vscode/extensions/kilocode.kilo-code-4.84.1/core/webview/webviewMessageHandler.ts:1681:5)",
  "message": [
    {
      "code": "invalid_type",
      "expected": "object",
      "received": "string",
      "path": [
        "vsCodeLmModelSelector"
      ],
      "message": "Expected object, received string"
    }
  ]
}

euxx avatar Aug 27 '25 06:08 euxx

Same issue. ~~It seems the only model it works with is 3.5 Sonnet.~~ All models throw the same error.

RenaldasK avatar Aug 27 '25 12:08 RenaldasK

Can confirm happening wth VS code insider

pboachie avatar Sep 07 '25 20:09 pboachie

Just to add on to this. First appeared in v4.84.0 Checked each version since and the same issue in all version. Last working version v4.83.1 v4.84.0 was the first version that brought switch model from the chat tab. 8.83.1, this was via the settings tab only.

v4.83.1 v4.84.0

BeeDoubleYouKay avatar Sep 08 '25 07:09 BeeDoubleYouKay

This seems to be fixed with the latest version that was released yesterday.

This seems to be fixed with the latest version that was released yesterday.

For me, it's not fixed, but is now usable I am now able to change model from settings page, but the drop down at the bottom of the page still isn't working correctly. When selecting a model from settings, it's shows up as: "copilot - gpt-5-mini" That same model in drop down under the chat shows as: "Copilot / Gpt 5 Mini" The other models, that I still can't change to in the drop down show as: "Gpt 5 Mini"

BeeDoubleYouKay avatar Sep 09 '25 16:09 BeeDoubleYouKay

This seems to be fixed with the latest version that was released yesterday.

For me, it's not fixed, but is now usable I am now able to change model from settings page, but the drop down at the bottom of the page still isn't working correctly. When selecting a model from settings, it's shows up as: "copilot - gpt-5-mini" That same model in drop down under the chat shows as: "Copilot / Gpt 5 Mini" The other models, that I still can't change to in the drop down show as: "Gpt 5 Mini"

Can confirm I am experiencing the same behaviour - can change the model via provider settings, but the chat dropdown still gives the same error.

VScode version: 1.104.0-insider Kilo code extension version: 4.91.2

RenaldasK avatar Sep 09 '25 18:09 RenaldasK

Still getting this error

oldschoola avatar Oct 24 '25 08:10 oldschoola