continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.25k stars 1.66k forks source link

The 'models' field should be a non-empty array #2714

Closed siom79 closed 2 weeks ago

siom79 commented 2 weeks ago

Before submitting your bug report

Relevant environment info

- OS: Fedora 39
- Continue version: 0.8.53
- IDE version: 1.94.2
- Model: custom model
- config.json:

{
  "models": [

  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export this session as markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "contextProviders": [
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "open",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    },
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    }
  ],
  "tabAutocompleteModel": {
    "title": "Starcoder 3b",
    "provider": "ollama",
    "model": "starcoder2:3b"
  },
  "allowAnonymousTelemetry": false,
  "embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text"
  },
  "docs": []
}

Description

We are using a custom model (inside config.ts) and no model inside config.json. This leads to the error message Error in config.json: The 'models' field should be a non-empty array. in the "web view developer tools" in VS code. The list of models to select from is empty and the custom model can no longer be used.

To reproduce

  1. Provide a custom model inside config.ts.
  2. Remove all models from config.json.

Log output

ERR [Extension Host] Error handling webview message: {
  "msg": {
    "messageId": "e01a726a-dd31-478d-9a8c-bab47ac3641a",
    "messageType": "context/loadSubmenuItems",
    "data": {
      "title": "docs"
    }
  }
}

Error in config.json: The 'models' field should be a non-empty array.