Skip to content

TypeError: Invalid URL #8548

@nutwg

Description

@nutwg

Before submitting your bug report

Relevant environment info

- OS:Windows 11
- Continue version:1.2.10
- IDE version: VScode 1.105.1(Any IDE)
- Model: Any Model
- config:
   yaml config

  
  OR link to agent in Continue hub:

Description

Image

After installing the Continue plugin in any IDE, sending messages using any Model (including the Default Assistant Model) results in the error "TypeError: Invalid URL". However, Continue works normally on other computers on the local network. I have tried reinstalling the Continue plugin and reinstalling new versions of VSCode and PHPStorm, but the problem remains unresolved.

To reproduce

After installing the Continue plugin, sending any message will trigger an error pop-up, making it impossible to use the Continue plugin normally.

Log output

Error handling webview message: {
  "msg": {
    "messageId": "d1ca303e-20b4-47aa-a9ca-de13353f04a8",
    "messageType": "llm/streamChat",
    "data": {
      "completionOptions": {
        "tools": [
          {
            "type": "function",
            "displayTitle": "Read File",
            "wouldLikeTo": "read {{{ filepath }}}",
            "isCurrently": "reading {{{ filepath }}}",
            "hasAlready": "read {{{ filepath }}}",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "read_file",
              "description": "Use this tool if you need to view the contents of an existing file.",
              "parameters": {
                "type": "object",
                "required": [
                  "filepath"
                ],
                "properties": {
                  "filepath": {
                    "type": "string",
                    "description": "The path of the file to read, relative to the root of the workspace (NOT uri or absolute path)"
                  }
                }
              }
            },
            "systemMessageDescription": {
              "prefix": "To read a file with a known filepath, use the read_file tool. For example, to read a file located at 'path/to/file.txt', you would respond with this:",
              "exampleArgs": [
                [
                  "filepath",
                  "path/to/the_file.txt"
                ]
              ]
            },
            "defaultToolPolicy": "allowedWithoutPermission",
            "toolCallIcon": "DocumentIcon"
          },
          {
            "type": "function",
            "displayTitle": "Create New File",
            "wouldLikeTo": "create {{{ filepath }}}",
            "isCurrently": "creating {{{ filepath }}}",
            "hasAlready": "created {{{ filepath }}}",
            "group": "Built-In",
            "readonly": false,
            "isInstant": true,
            "function": {
              "name": "create_new_file",
              "description": "Create a new file. Only use this when a file doesn't exist and should be created",
              "parameters": {
                "type": "object",
                "required": [
                  "filepath",
                  "contents"
                ],
                "properties": {
                  "filepath": {
                    "type": "string",
                    "description": "The path where the new file should be created, relative to the root of the workspace"
                  },
                  "contents": {
                    "type": "string",
                    "description": "The contents to write to the new file"
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithPermission",
            "systemMessageDescription": {
              "prefix": "To create a NEW file, use the create_new_file tool with the relative filepath and new contents. For example, to create a file located at 'path/to/file.txt', you would respond with:",
              "exampleArgs": [
                [
                  "filepath",
                  "path/to/the_file.txt"
                ],
                [
                  "contents",
                  "Contents of the file"
                ]
              ]
            }
          },
          {
            "type": "function",
            "displayTitle": "Run Terminal Command",
            "wouldLikeTo": "run the following terminal command:",
            "isCurrently": "running the following terminal command:",
            "hasAlready": "ran the following terminal command:",
            "readonly": false,
            "group": "Built-In",
            "function": {
              "name": "run_terminal_command",
              "description": "Run a terminal command in the current directory.\nThe shell is not stateful and will not remember any previous commands.      When a command is run in the background ALWAYS suggest using shell commands to stop it; NEVER suggest using Ctrl+C.      When suggesting subsequent shell commands ALWAYS format them in shell command blocks.      Do NOT perform actions requiring special/admin privileges.      Choose terminal commands and scripts optimized for win32 and x64 and shell powershell.exe.",
              "parameters": {
                "type": "object",
                "required": [
                  "command"
                ],
                "properties": {
                  "command": {
                    "type": "string",
                    "description": "The command to run. This will be passed directly into the IDE shell."
                  },
                  "waitForCompletion": {
                    "type": "boolean",
                    "description": "Whether to wait for the command to complete before returning. Default is true. Set to false to run the command in the background. Set to true to run the command in the foreground and wait to collect the output."
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithPermission",
            "systemMessageDescription": {
              "prefix": "To run a terminal command, use the run_terminal_command tool\nThe shell is not stateful and will not remember any previous commands.      When a command is run in the background ALWAYS suggest using shell commands to stop it; NEVER suggest using Ctrl+C.      When suggesting subsequent shell commands ALWAYS format them in shell command blocks.      Do NOT perform actions requiring special/admin privileges.      Choose terminal commands and scripts optimized for win32 and x64 and shell powershell.exe.\nYou can also optionally include the waitForCompletion argument set to false to run the command in the background.      \nFor example, to see the git log, you could respond with:",
              "exampleArgs": [
                [
                  "command",
                  "git log"
                ]
              ]
            }
          },
          {
            "type": "function",
            "displayTitle": "Glob File Search",
            "wouldLikeTo": "search for files like \"{{{ pattern }}}\"",
            "isCurrently": "searching for files like \"{{{ pattern }}}\"",
            "hasAlready": "searched for files like \"{{{ pattern }}}\"",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "file_glob_search",
              "description": "Search for files recursively in the project using glob patterns. Supports ** for recursive directory search. Will not show many build, cache, secrets dirs/files (can use ls tool instead). Output may be truncated; use targeted patterns",
              "parameters": {
                "type": "object",
                "required": [
                  "pattern"
                ],
                "properties": {
                  "pattern": {
                    "type": "string",
                    "description": "Glob pattern for file path matching"
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithoutPermission",
            "systemMessageDescription": {
              "prefix": "To return a list of files based on a glob search pattern, use the file_glob_search tool",
              "exampleArgs": [
                [
                  "pattern",
                  "*.py"
                ]
              ]
            },
            "toolCallIcon": "MagnifyingGlassIcon"
          },
          {
            "type": "function",
            "displayTitle": "View Diff",
            "wouldLikeTo": "view the git diff",
            "isCurrently": "getting the git diff",
            "hasAlready": "viewed the git diff",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "view_diff",
              "description": "View the current diff of working changes",
              "parameters": {
                "type": "object",
                "properties": {}
              }
            },
            "systemMessageDescription": {
              "prefix": "To view the current git diff, use the view_diff tool. This will show you the changes made in the working directory compared to the last commit."
            },
            "defaultToolPolicy": "allowedWithoutPermission",
            "toolCallIcon": "CodeBracketIcon"
          },
          {
            "type": "function",
            "displayTitle": "Read Currently Open File",
            "wouldLikeTo": "read the current file",
            "isCurrently": "reading the current file",
            "hasAlready": "read the current file",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "read_currently_open_file",
              "description": "Read the currently open file in the IDE. If the user seems to be referring to a file that you can't see, or is requesting an action on content that seems missing, try using this tool.",
              "parameters": {
                "type": "object",
                "properties": {}
              }
            },
            "defaultToolPolicy": "allowedWithPermission",
            "systemMessageDescription": {
              "prefix": "To view the user's currently open file, use the read_currently_open_file tool.\nIf the user is asking about a file and you don't see any code, use this to check the current file"
            },
            "toolCallIcon": "DocumentTextIcon"
          },
          {
            "type": "function",
            "displayTitle": "ls",
            "wouldLikeTo": "list files in {{{ dirPath }}}",
            "isCurrently": "listing files in {{{ dirPath }}}",
            "hasAlready": "listed files in {{{ dirPath }}}",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "ls",
              "description": "List files and folders in a given directory",
              "parameters": {
                "type": "object",
                "properties": {
                  "dirPath": {
                    "type": "string",
                    "description": "The directory path relative to the root of the project. Use forward slash paths like '/'. rather than e.g. '.'"
                  },
                  "recursive": {
                    "type": "boolean",
                    "description": "If true, lists files and folders recursively. To prevent unexpected large results, use this sparingly"
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithoutPermission",
            "systemMessageDescription": {
              "prefix": "To list files and folders in a given directory, call the ls tool with \"dirPath\" and \"recursive\". For example:",
              "exampleArgs": [
                [
                  "dirPath",
                  "path/to/dir"
                ],
                [
                  "recursive",
                  "false"
                ]
              ]
            },
            "toolCallIcon": "FolderIcon"
          },
          {
            "type": "function",
            "displayTitle": "Create Rule Block",
            "wouldLikeTo": "create a rule block for \"{{{ name }}}\"",
            "isCurrently": "creating a rule block for \"{{{ name }}}\"",
            "hasAlready": "created a rule block for \"{{{ name }}}\"",
            "readonly": false,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "create_rule_block",
              "description": "Creates a \"rule\" that can be referenced in future conversations. This should be used whenever you want to establish code standards / preferences that should be applied consistently, or when you want to avoid making a mistake again. To modify existing rules, use the edit tool instead.\n\nRule Types:\n- Always: Include only \"rule\" (always included in model context)\n- Auto Attached: Include \"rule\", \"globs\", and/or \"regex\" (included when files match patterns)\n- Agent Requested: Include \"rule\" and \"description\" (AI decides when to apply based on description)\n- Manual: Include only \"rule\" (only included when explicitly mentioned using @ruleName)",
              "parameters": {
                "type": "object",
                "required": [
                  "name",
                  "rule"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Short, descriptive name summarizing the rule's purpose (e.g. 'React Standards', 'Type Hints')"
                  },
                  "rule": {
                    "type": "string",
                    "description": "Clear, imperative instruction for future code generation (e.g. 'Use named exports', 'Add Python type hints'). Each rule should focus on one specific standard."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of when this rule should be applied. Required for Agent Requested rules (AI decides when to apply). Optional for other types."
                  },
                  "globs": {
                    "type": "string",
                    "description": "Optional file patterns to which this rule applies (e.g. ['**/*.{ts,tsx}'] or ['src/**/*.ts', 'tests/**/*.ts'])"
                  },
                  "regex": {
                    "type": "string",
                    "description": "Optional regex patterns to match against file content. Rule applies only to files whose content matches the pattern (e.g. 'useEffect' for React hooks or '\\bclass\\b' for class definitions)"
                  },
                  "alwaysApply": {
                    "type": "boolean",
                    "description": "Whether this rule should always be applied. Set to false for Agent Requested and Manual rules. Omit or set to true for Always and Auto Attached rules."
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithPermission",
            "systemMessageDescription": {
              "prefix": "Sometimes the user will provide feedback or guidance on your output. If you were not aware of these \"rules\", consider using the create_rule_block tool to persist the rule for future interactions.\nThis tool cannot be used to edit existing rules, but you can search in the \".continue/rules\" folder and use the edit tool to manage rules.\nTo create a rule, respond with a create_rule_block tool call and the following arguments:\n- name: Short, descriptive name summarizing the rule's purpose (e.g. 'React Standards', 'Type Hints')\n- rule: Clear, imperative instruction for future code generation (e.g. 'Use named exports', 'Add Python type hints'). Each rule should focus on one specific standard.\n- description: Description of when this rule should be applied. Required for Agent Requested rules (AI decides when to apply). Optional for other types.\n- globs: Optional file patterns to which this rule applies (e.g. ['**/*.{ts,tsx}'] or ['src/**/*.ts', 'tests/**/*.ts'])\n- alwaysApply: Whether this rule should always be applied. Set to false for Agent Requested and Manual rules. Omit or set to true for Always and Auto Attached rules.\nFor example:",
              "exampleArgs": [
                [
                  "name",
                  "Use PropTypes"
                ],
                [
                  "rule",
                  "Always use PropTypes when declaring React component properties"
                ],
                [
                  "description",
                  "Ensure that all prop types are explicitly declared for better type safety and code maintainability in React components."
                ],
                [
                  "globs",
                  "**/*.js"
                ],
                [
                  "alwaysApply",
                  "false"
                ]
              ]
            },
            "toolCallIcon": "PencilIcon"
          },
          {
            "type": "function",
            "displayTitle": "Read URL",
            "wouldLikeTo": "fetch {{{ url }}}",
            "isCurrently": "fetching {{{ url }}}",
            "hasAlready": "fetched {{{ url }}}",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "fetch_url_content",
              "description": "Can be used to view the contents of a website using a URL. Do NOT use this for files.",
              "parameters": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The URL to read"
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithPermission",
            "systemMessageDescription": {
              "prefix": "To fetch the content of a URL, use the fetch_url_content tool. For example, to read the contents of a webpage, you might respond with:",
              "exampleArgs": [
                [
                  "url",
                  "https://example.com"
                ]
              ]
            },
            "toolCallIcon": "GlobeAltIcon"
          },
          {
            "type": "function",
            "displayTitle": "Search Web",
            "wouldLikeTo": "search the web for \"{{{ query }}}\"",
            "isCurrently": "searching the web for \"{{{ query }}}\"",
            "hasAlready": "searched the web for \"{{{ query }}}\"",
            "readonly": true,
            "group": "Built-In",
            "function": {
              "name": "search_web",
              "description": "Performs a web search, returning top results. Use this tool sparingly - only for questions that require specialized, external, and/or up-to-date knowledege. Common programming questions do not require web search.",
              "parameters": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "The natural language search query"
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithoutPermission",
            "systemMessageDescription": {
              "prefix": "To search the web, use the search_web tool with a natural language query. For example, to search for the current weather, you would respond with:",
              "exampleArgs": [
                [
                  "query",
                  "What is the current weather in San Francisco?"
                ]
              ]
            },
            "toolCallIcon": "GlobeAltIcon"
          },
          {
            "type": "function",
            "displayTitle": "Multi Edit",
            "wouldLikeTo": "edit {{{ filepath }}}",
            "isCurrently": "editing {{{ filepath }}}",
            "hasAlready": "edited {{{ filepath }}}",
            "group": "Built-In",
            "readonly": false,
            "isInstant": false,
            "function": {
              "name": "multi_edit",
              "description": "Use this tool to make multiple edits to a single file in one operation. It allows you to perform multiple find-and-replace operations efficiently. \n\nTo make multiple edits to a file, provide the following:\n1. filepath: The path to the file to modify, RELATIVE to the project/workspace root (verify the directory path is correct)\n2. edits: An array of edit operations to perform, where each edit contains:\n   - old_string: The text to replace (must match the old file contents exactly, including all whitespace/indentation)\n   - new_string: The edited text to replace the old_string\n   - replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.\n\nIMPORTANT:\n- Files may be modified between tool calls by users, linters, etc, so always make all edits in one tool call where possible. For example, do not only edit imports if there are other changes in the file, as unused imports may be removed by a linter between tool calls.\n- All edits are applied in sequence, in the order they are provided\n- Each edit operates on the result of the previous edit, so plan your edits carefully to avoid conflicts between sequential operations\n- Edits are atomic - all edits must be valid for the operation to succeed - if any edit fails, none will be applied\n- This tool is ideal when you need to make several changes to different parts of the same file\n\nCRITICAL REQUIREMENTS:\n1. ALWAYS use the read_file tool just before making edits, to understand the file's up-to-date contents and context. The user can also edit the file while you are working with it.\n2. This tool CANNOT be called in parallel with other tools.\n3. When making edits:\n- Ensure all edits result in idiomatic, correct code\n- Do not leave the code in a broken state\n- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked\n- Use replace_all for replacing and renaming all matches for a string across the file. This parameter is useful if you want to rename a variable, for instance\n\nWARNINGS:\n- If earlier edits affect the text that later edits are trying to find, files can become mangled\n- The tool will fail if edits.old_string doesn't match the file contents exactly (including whitespace)\n- The tool will fail if edits.old_string and edits.new_string are the same - they MUST be different",
              "parameters": {
                "type": "object",
                "required": [
                  "filepath",
                  "edits"
                ],
                "properties": {
                  "filepath": {
                    "type": "string",
                    "description": "The path to the file to modify, relative to the root of the workspace"
                  },
                  "edits": {
                    "type": "array",
                    "description": "Array of edit operations to perform sequentially on the file",
                    "items": {
                      "type": "object",
                      "required": [
                        "old_string",
                        "new_string"
                      ],
                      "properties": {
                        "old_string": {
                          "type": "string",
                          "description": "The text to replace (exact match including whitespace/indentation)"
                        },
                        "new_string": {
                          "type": "string",
                          "description": "The text to replace it with. MUST be different than old_string."
                        },
                        "replace_all": {
                          "type": "boolean",
                          "description": "Replace all occurrences of old_string (default false) in the file"
                        }
                      }
                    }
                  }
                }
              }
            },
            "systemMessageDescription": {
              "prefix": "To make multiple edits to a single file, use the multi_edit tool with a filepath (relative to the root of the workspace) and an array of edit operations.\n\n  For example, you could respond with:",
              "exampleArgs": [
                [
                  "filepath",
                  "path/to/file.ts"
                ],
                [
                  "edits",
                  "[\n  { \"old_string\": \"const oldVar = 'value'\", \"new_string\": \"const newVar = 'updated'\" },\n  { \"old_string\": \"oldFunction()\", \"new_string\": \"newFunction()\", \"replace_all\": true }\n]"
                ]
              ]
            },
            "defaultToolPolicy": "allowedWithPermission"
          },
          {
            "type": "function",
            "displayTitle": "Grep Search",
            "wouldLikeTo": "search for \"{{{ query }}}\"",
            "isCurrently": "searching for \"{{{ query }}}\"",
            "hasAlready": "searched for \"{{{ query }}}\"",
            "readonly": true,
            "isInstant": true,
            "group": "Built-In",
            "function": {
              "name": "grep_search",
              "description": "Perform a search over the repository using ripgrep. Will not include results for many build, cache, secrets dirs/files. Output may be truncated, so use targeted queries",
              "parameters": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "The search query to use. Must be a valid ripgrep regex expression, escaped where needed"
                  }
                }
              }
            },
            "defaultToolPolicy": "allowedWithoutPermission",
            "systemMessageDescription": {
              "prefix": "To perform a grep search within the project, call the grep_search tool with the query pattern to match. For example:",
              "exampleArgs": [
                [
                  "query",
                  ".*main_services.*"
                ]
              ]
            },
            "toolCallIcon": "MagnifyingGlassIcon"
          }
        ],
        "reasoning": true,
        "reasoningBudgetTokens": 2048
      },
      "title": "Claude Sonnet 4.5",
      "messages": [
        {
          "role": "system",
          "content": "<important_rules>\n  You are in agent mode.\n\n  If you need to use multiple tools, you can call multiple read only tools simultaneously.\n\n  Always include the language and file name in the info string when you write code blocks.\n  If you are editing \"src/main.py\" for example, your code block should start with ' src/main.py'\n\n\nFor larger codeblocks (>20 lines), use brief language-appropriate placeholders for unmodified sections, e.g. '// ... existing code ...'\n\nHowever, only output codeblocks for suggestion and demonstration purposes, for example, when enumerating multiple hypothetical options. For implementing changes, use the edit tools.\n\n</important_rules>"
        },
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "test"
            }
          ]
        }
      ],
      "messageOptions": {
        "precompiled": true
      }
    }
  }
}

TypeError: Invalid URL

Metadata

Metadata

Assignees

Labels

area:chatRelates to chat interfaceide:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on Windows

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions