obsidian-github-copilot icon indicating copy to clipboard operation
obsidian-github-copilot copied to clipboard

Copilot completion not working: Error parsing JSON

Open Alb-O opened this issue 8 months ago • 3 comments

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:

  1. Install and setup this plugin + Copilot correctly - Copilot chat is working correctly.
  2. Typing in markdown editor doesn't produce any completions.
  3. Check console to see above error.

Expected behavior Completions work.

Screenshots

Image

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

Alb-O avatar Apr 27 '25 07:04 Alb-O

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?

tobiasdiez avatar May 10 '25 12:05 tobiasdiez

Seems to be an issue on Windows only. On my Mac everything works. I sync all of my plugins/settings.

nikolamilekic avatar Sep 12 '25 09:09 nikolamilekic

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.

painh avatar Oct 12 '25 09:10 painh