Copilot - No token found but auth successful #3119
-
|
Hi, Moving to a new computer and using the exact same NeoVim config as on the old one but despite that I get the following when using CodeCompanion chat:
I get the same error with minimal.lua though I had to add Any idea what could be causing this? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
|
CodeCompanion does not ask the Copilot plugin whether authentication succeeded; it looks for Copilot's token files on disk. The adapter searches under the configured token parent for: So first check where those files are on the new machine: ls ~/.config/github-copilot/hosts.json ~/.config/github-copilot/apps.json
echo "$XDG_CONFIG_HOME"If your Copilot plugin stored them somewhere else, set the parent directory before CodeCompanion starts, for example: let $CODECOMPANION_TOKEN_PATH = expand('~/.config')Use the actual parent directory that contains |
Beta Was this translation helpful? Give feedback.
-
|
This seems to be a copilot.lua issue, it is not writing either of those files, just a sqlite db. |
Beta Was this translation helpful? Give feedback.
-
|
@olimorris Seems apps.json isn't coming back and that tokens will be read from the sqlite db. |
Beta Was this translation helpful? Give feedback.
-
|
If you're choosing to put the token on disk with copilot.lua, then I'm sure that their latest release breaks that. But what about Copilot CLI or copilot.vim? |
Beta Was this translation helpful? Give feedback.
-
|
#3155 has added support for tokens via the SQLite database. The Copilot adapter has caching built in so this should be relatively performant. @PerMalmberg would appreciate you testing this on your machine. I've confirmed it working on mine but the current hierarchy in the Copilot adapter is to search for the token in the JSON files and then fallback to the SQLite db. I'm not sure if that's the correct logic. |
Beta Was this translation helpful? Give feedback.
#3155 has added support for tokens via the SQLite database. The Copilot adapter has caching built in so this should be relatively performant.
@PerMalmberg would appreciate you testing this on your machine. I've confirmed it working on mine but the current hierarchy in the Copilot adapter is to search for the token in the JSON files and then fallback to the SQLite db. I'm not sure if that's the correct logic.