wingman-ai: [BUG] - Reloading ollama models crashes code

Description

Now that #81 is fixed I can configure wingman, but I cannot set the models the first time.

Image

If I click the reload button next to the dropdowns vscode will go blank and restart.

Environment

  • VSCode Version:
  • Wingman-AI Version:
  • Operating System:
  • AI Provider being used (OpenAI/Anthropic/Ollama/etc):

Logs

Please provide relevant logs from VSCode:

The output of the wingman ext is a bit sparse:

3/26/2025, 7:59:37 PM - [info] Using native binding package for lancedb: @lancedb/lancedb-linux-x64-gnu
3/26/2025, 7:59:37 PM - [info] Using native binding package for lancedb: @lancedb/lancedb-linux-x64-gnu
3/26/2025, 7:59:37 PM - [info] Generated target filename for lancedb: lancedb.linux-x64-gnu.node
3/26/2025, 7:59:37 PM - [info] lancedb binding already installed.
3/26/2025, 7:59:37 PM - [info] Using native binding package for ast-grep-napi: @ast-grep/napi-linux-x64-gnu
3/26/2025, 7:59:37 PM - [info] Using native binding package for ast-grep-napi: @ast-grep/napi-linux-x64-gnu
3/26/2025, 7:59:37 PM - [info] Generated target filename for ast-grep-napi: ast-grep-napi.linux-x64-gnu.node
3/26/2025, 7:59:37 PM - [info] ast-grep-napi binding already installed.
3/26/2025, 8:03:44 PM - [info] AI Provider Anthropic is not configured correctly. If you're using Ollama, try changing the model and saving your settings.

The annoying part is that it seems everything is lost when the window reloads. There are models after it crashes though, so as long as I don’t need to refresh them I think its okay.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 40 (16 by maintainers)

Most upvoted comments

All path.join’s were removed, there is a two stage validation one for the AI provider and one for the embeddings, they are slightly different. AI provider will do a fetch to Ollama to validate the models exist, embedding does not. It just validates that all the fields have values.

But enabling embeddings has a lot of side effects, it has to start the language server if it failed to start, then it has to start the vector database, but before that it has to generate the glob paths. And with Ollama that can be slow. It also gets complicated if you change the dimensions, so if they were loaded but you changed it, I have to reinitialize the database

I did forget to update the embedding model loaders - that should be in 1.4.19 I just pushed out 😃

Ah, there’s your issue - I should have noticed it earlier.

path.join() isn’t intended for URLs. It’s for filesystem paths. It might work on UNIX-like hosts because of the forward slash, but on Windows hosts, here’s what path.join() returns for me: 'http:\\ai.11434\\api\\tags'. It uses the Windows path separator and escapes them.

You know I didn’t even think about this, good catch! Releasing an update now that should fix it 😃

Sorry to hear, I just released 1.4.16 and that will now reload the model list as you change the URL in the text box without saving. Hopefully this fixes it

Thanks for reporting! The old extension logic was to refresh the entire editor window and I’ve been trying to move away from that.

But if you have Ollama running and it still shows failed to load, I should have a fix tomorrow