Copilot completion not working: Error parsing JSON
Describe the bug Copilot completion doesn't work, and produces this error in the console:
Error parsing JSON: SyntaxError: Unexpected non-whitespace character after JSON at position 127 (line 1 column 128)
To Reproduce Steps to reproduce the behavior:
- Install and setup this plugin + Copilot correctly - Copilot chat is working correctly.
- Typing in markdown editor doesn't produce any completions.
- Check console to see above error.
Expected behavior Completions work.
Screenshots
Obsidian and environment (please complete the following information):
- OS: Windows 11
- Obsidian version: 1.8.10
- Plugin version [e.g. 1.0.0] : 1.1.2
I have the same error. It's triggered at https://github.com/Pierrad/obsidian-github-copilot/blob/7efebeffb734592386139810c8d103824026a790/src/copilot/CopilotAgent.ts#L103-L105.
For me, there seems to be a couple of things that go wrong.
First, the string is:
{"jsonrpc":"2.0","method":"statusNotification","params":{"busy":false,"kind":"Error","status":"Error","message":"You are not signed into GitHub."}}Content-Length: 127
{"jsonrpc":"2.0","method":"didChangeStatus","params":{"busy":false,"kind":"Error","message":"You are not signed into GitHub."}}Content-Length: 58
{"jsonrpc":"2.0","id":1,"result":{"status":"NotSignedIn"}}
Note the "Content-Length" part. It's really in the string, which hence is indeed not a valid json.
But I'm also wondering in the first place why it says that I'm not signed in. I can actually chat without any issues. Is the auth code shared between the auto-completion and the chat?
Seems to be an issue on Windows only. On my Mac everything works. I sync all of my plugins/settings.
I experienced the same error, but in the settings window of Github Coplilot
I re-authenticated with the Restart sign-in process button
It has been verified that it is running.