Skip to content

JSONDecodeError on all commands #90

Description

@Axelwickm

Hello! I'm having trouble getting any of the commands to work. Getting the following traceback.

May be something basic that I have just missed, but I've been struggling for a while, so in that case it may be good to have in the documentation or healthcheck.

Traceback (most recent call last):
  File "/home/axel/.local/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/copilot_plugin.py", line 47, in copilot_agent_cmd
    self.vsplit_chat_handler.chat(args[0], file_type, code)
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/handlers/vsplit_chat_handler.py", line 62, in chat
    super().chat(prompt, filetype, code, self.nvim.current.window.handle)
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/handlers/chat_handler.py", line 74, in chat
    self._add_chat_messages(
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/handlers/chat_handler.py", line 308, in _add_chat_messages
    for token in self.copilot.ask(
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/copilot.py", line 144, in ask
    error_code = response.json().get("error", {}).get("code")
  File "/home/axel/.local/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

:Copilot status

[Copilot] Online
[Copilot] Enabled for html
[Copilot] Warning: Node.js 16 is approaching end of life and support will be dropped in a future release.

:Copilot version

Neovim 0.9.5
copilot.vim 1.13.0
copilot.lua f7612f5af4a7d7615babf43ab1e67a2d790c13a6
copilot/dist/agent.js 1.155.0
Node.js 16.18.0
Warning: Node.js 16 is approaching end of life and support will be dropped in a future release.

CopilotChat.nvim.log


[INFO  Wed 28 Feb 2024 02:30:28 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: Prompt: Explain how it works.
[INFO  Wed 28 Feb 2024 02:30:28 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: Code: Traceback (most recent call last):
  File "/home/axel/.local/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/copilot_plugin.py", line 47, in copilot_agent_cmd
    self.vsplit_chat_handler.chat(args[0], file_type, code)
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/handlers/vsplit_chat_handler.py", line 62, in chat
    super().chat(prompt, filetype, code, self.nvim.current.window.handle)
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/handlers/chat_handler.py", line 74, in chat
    self._add_chat_messages(
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/handlers/chat_handler.py", line 308, in _add_chat_messages
    for token in self.copilot.ask(
  File "/home/axel/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/CopilotChat/copilot.py", line 144, in ask
    error_code = response.json().get("error", {}).get("code")
  File "/home/axel/.local/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[INFO  Wed 28 Feb 2024 02:30:28 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: File type: html
[INFO  Wed 28 Feb 2024 02:30:28 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: Model: gpt-4
[INFO  Wed 28 Feb 2024 02:30:28 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: Temperature: 0.1
[INFO  Wed 28 Feb 2024 02:30:28 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: Asking Copilot
[INFO  Wed 28 Feb 2024 02:32:02 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: Execute ":UpdateRemotePlugins" and restart Neovim before starting a chat with Copilot.
[INFO  Wed 28 Feb 2024 02:32:02 PM WET] ...are/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/utils.lua:41: If issues arise, run ":healthcheck" and share the output.

I have run :UpdateRemotePlugins, and Copilot plugins work.

Any ideas?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions