continuedev / continuedev/continue

0.9.244: "message":"Unauthorized" when using codestral autocomplete default configuration

Open
#3,375 7 comments 9 reactions 1 assignee View on GitHub

@RomneyDa is already working on this.

Since Dec 14, 2024.

area:autocomplete ide:vscode kind:bug needs-triage os:linux stale
Dominant language
TypeScript
Stars
36k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Before submitting your bug report
Relevant environment info
- OS: Linux
- Continue version: 0.9.244
- IDE version: VSCode 1.95.3
- Model: Claude Sonnet 3.5
- config.json:
  
{
  "models": [
    {
      "model": "claude-3-5-sonnet-latest",
      "provider": "anthropic",
      "apiKey": "XXX",
      "title": "Claude 3.5 Sonnet"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": "XXX"
  },
  "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ]
}
Description

By using default config.json with a codestral API key (not the general one), I get an error popup: "message":"Unauthorized" on each completion attempt:

2024-12-14-19:16:48-screenshot

This can be fixed by adding: "apiBase": "https://codestral.mistral.ai/v1" to the tabAutocompleteModel

But according to documentation (https://docs.continue.dev/autocomplete/model-setup), I understand that i should set apiBase only when using the general API.

Here i understand that https://codestral.mistral.ai/v1 is the default value when using codestral:
https://github.com/continuedev/continue/blob/main/core/llm/llms/Mistral.ts#L23

But somehow, this does not seems to be taken into account.

I do not know if the code should be fixed to use it as default apiBase, or if the documentation should be modified to be more explicit about setting apiBase when using codestral

This make the default configuration not working out of the box.
This issue is not present in 0.9.241 and was introduced in 0.9.242.

(with 0.9.241, there is no need to set apiBase in tabAutocompleteModel)

To reproduce
  1. Install continue >= 0.9.242
  2. rm ~/.continue/config.json to force a default config
  3. set your codestral apiKey
  4. ask for completion by writing code
Log output
Extension Host] Error generating autocompletion:  Error: {
  "message":"Unauthorized",
  "request_id":"f63aed38b328bb35e6895f0da2714b59"
}
	at streamResponse (/home/bergamote/.vscode/extensions/continue.continue-0.9.244-linux-x64/out/extension.js:72163:11)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async streamSse (/home/bergamote/.vscode/extensions/continue.continue-0.9.244-linux-x64/out/extension.js:72208:20)
	at async OpenAIApi.fimStream (/home/bergamote/.vscode/extensions/continue.continue-0.9.244-linux-x64/out/extension.js:96555:26)
	at async _Mistral.streamFim (/home/bergamote/.vscode/extensions/continue.continue-0.9.244-linux-x64/out/extension.js:108340:28)
	at async ListenableGenerator._start (/home/bergamote/.vscode/extensions/continue.continue-0.9.244-linux-x64/out/extension.js:113738:28)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.