Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
baipaiha opened this issue Dec 14, 2024 · 6 comments
Open
3 tasks done
Assignees
Labels
area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"

Comments

@baipaiha
Copy link
Contributor

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)
@dosubot dosubot bot added area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Dec 14, 2024
@priyashpatil
Copy link
Contributor

Can confirm. Getting same error.

@IngLP
Copy link

IngLP commented Dec 15, 2024

+1

1 similar comment
@mpbrenlla
Copy link

+1

@MattLoyeD
Copy link

+1 as well,

@fev4
Copy link

fev4 commented Dec 16, 2024

thanks for debugging the issue, initially this was only present in the pre-release version, so I went back to the released version in order to avoid the issue, but recently seems to have reached the released version as well

@gabdara
Copy link

gabdara commented Dec 16, 2024

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

Thanks! This solved it for me for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"
Projects
None yet
Development

No branches or pull requests

8 participants