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
13.67k stars 960 forks source link

Cannot read properties of undefined (reading 'toLowerCase') #1210

Open ibehnam opened 2 months ago

ibehnam commented 2 months ago

Before submitting your bug report

Relevant environment info

Happened out of the blue and the only way to get rid of this annoying issue is to completely disable the extension. It happens on the stable and pre-release branches.

Description

Kapture 2024-05-01 at 00 20 46

To reproduce

No response

Log output

No response

sestinj commented 2 months ago

@ibehnam Do you happen to have a CustomLLM in your config.ts? I saw this for the first time yesterday when I was adding one of my own

ibehnam commented 2 months ago

@sestinj I use the following LLMs in my config if that helps:

{
  "allowAnonymousTelemetry": false,
  "models": [
    {
      "tabAutocompleteModel": {
        "title": "πŸ’» Tab Autocomplete Model",
        "provider": "ollama",
        "model": "deepseek-coder:6.7b",
        "apiBase": "https://localhost:11434"
      },
      "tabAutocompleteOptions": {
        "useCopyBuffer": true,
        "useSuffix": true,
        "multilineCompletions": true,
        "maxPromptTokens": 400,
        "prefixPercentage": 0.5
      }
    },
    {
      "title": "πŸ’»OL🐒⭐ Phi-3",
      "model": "phi3",
      "provider": "ollama",
      "contextLength": 4096
    },
    {
      "title": "πŸ’»OL🐒⭐ codegemma:7b-code-q8_0",
      "model": "llama3:8b-instruct-q8_0",
      "provider": "ollama",
      "contextLength": 16384
    },
    {
      "title": "πŸ’»OL🐒⭐ Llama-3-8B",
      "model": "llama3:8b-instruct-q8_0",
      "provider": "ollama",
      "contextLength": 16384
    },
    {
      "title": "πŸ’»OL🐒⭐ DeepSeek:6.7B",
      "model": "DeepSeek-Coder:6.7B",
      "provider": "ollama",
      "contextLength": 16384
    },
    {
      "title": "πŸ›œOR🏎️⭐ Haiku",
      "model": "anthropic/claude-3-haiku:beta",
      "provider": "openai",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "...",
      "contextLength": 200000
    },
    {
      "title": "πŸ›œOR⭐⭐ Sonnet",
      "model": "anthropic/claude-3-sonnet:beta",
      "provider": "openai",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "...",
      "contextLength": 200000
    },
    {
      "title": "πŸ›œOR⭐⭐⭐ Opus",
      "model": "anthropic/claude-3-opus:beta",
      "provider": "openai",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "...",
      "contextLength": 200000
    },
    {
      "title": "πŸ›œOR⭐⭐⭐ GPT-4",
      "model": "openai/gpt-4-1106-preview",
      "contextLength": 32768,
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "...",
      "completionOptions": {
        "temperature": 0.8,
        "topK": 50,
        "topP": 0.9,
        "presencePenalty": 1,
        "frequencyPenalty": 1
      },
      "provider": "openai"
    }
  ],
  "systemMessage": "Act like a professional Python and Rust developer. Always use types, annotations, and elegant algorithms. Write clean, efficient, and maintainable code. Assume all necessary imports are already installed and imported, so do NOT import them. Don't talk---just write the code. Don't explain your code unless asked.",
  "completionOptions": {
    "temperature": 0.8,
    "topP": 0.9,
    "topK": 50,
    "presencePenalty": 1,
    "frequencyPenalty": 1,
    "maxTokens": 2048
  },
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit highlighted code"
    },
    {
      "name": "comment",
      "description": "Write comments for the highlighted code"
    },
    {
      "name": "share",
      "description": "Download and share this session"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    }
  ],
  "customCommands": [
    {
      "name": "cc",
      "prompt": "Fix the code. Keep the code comments to a minimum. Your answer should be only the fixed code.",
      "description": "fix the highlighted code"
    },
    {
      "name": "vv",
      "prompt": "What's the Vim command or shortcut to do this? Your answer should be only the Vim command or shortcut.",
      "description": "Vim How-To"
    },
    {
      "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": "codebase",
      "params": {
        "nRetrieve": 25,
        "nFinal": 5,
        "useReranking": true
      }
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "open",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "open"
    },
    {
      "name": "search"
    },
    {
      "name": "url",
      "params": {
        "presetUrls": [
          "https://continue.dev/docs/customization",
          "https://news.ycombinator.com"
        ]
      }
    },
    {
      "name": "tree"
    },
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    }
  ],
  "tabAutocompleteModel": {
    "title": "Tab Autocomplete",
    "provider": "free-trial",
    "model": "starcoder-7b"
  },
  "embeddingsProvider": {
    "provider": "free-trial"
  },
  "reranker": {
    "name": "free-trial"
  }
}