You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
~/.config/github-copilot/apps.json not created/saved even though authentication succeeds #284
I've been successfully using copilot.vim 1.59.0 in Neovim 0.12.2 on Ubuntu 22.04.5 with a corporate Github Copilot subscription; I can verify that authentication succeeds and that completions are successfully processed when I edit code (and if I examine the copilot.vim log). Recently, however, it seems that the plugin isn't saving the authentication token into apps.json. This poses issues with another vim plugin that relies upon copilot.vim for authentication (https://github.com/olimorris/codecompanion.nvim). Any thoughts as to what could be preventing the apps.json file from being created/saved? The ~/.config/github-copilot/ folder appears to be writable, i.e., I can manually save files there. Tried deleting the whole directory before starting Neovim and authenticating; after authentication, the directory was recreated; it contains auth.db, auth.db-shm, auth.db-wal, versions.json, but not apps.json
changed the title [-]~/.config/github-copilot/hosts.json not created/saved even though authentication succeeds[/-][+]~/.config/github-copilot/apps.json not created/saved even though authentication succeeds[/+]on May 20, 2026
I asked Github Copilot to analyze the copilot.vim codebase and investigate why auth.db might exist without apps.json. Here is what it found:
auth.db and apps.json have different triggers.
auth.db = state database. Created when client advertises copilotCapabilities.stateDatabase: true; server initializes SQLite under config dir. It can happen at startup, before any auth succeeds.
apps.json = Copilot GitHub auth record. Created only after persistent Copilot sign-in saves {user, oauth_token, githubAppId} or startup migrates valid old hosts.json.
So auth.db without apps.json means likely:
- Client enabled state DB, but sign-in never completed.
- Auth came from env token (GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, Codespaces GITHUB_TOKEN) → no persistent apps.json.
- Dynamic/MCP OAuth stored sessions in state DB, not Copilot GitHub auth.
- Existing hosts.json absent/invalid/no user or oauth_token, so migration skipped.
- Path mismatch: $XDG_CONFIG_HOME/github-copilot used for one expectation, not ~/.config/github-copilot.
For plain copilot.vim, current Vim client does not set stateDatabase, so it should not create auth.db by itself. If auth.db appears, likely another client/integration or different init options set that capability.
I'm not setting XDG_CONFIG_HOME or any of the *TOKEN env variables on my system, so I don't think those are the causes of the problem. Some of the other comments, though, make me wonder whether one of the other plugins I have installed is interfering with copilot.vim. Will try disabling everything except copilot.vim, codecompanion.nvim, and related dependencies and see what happens.
I did some digging and it seems newer versions of the LSP do not use apps.json anymore, and only write to the new sqlite3 database.
Other apps like codecompanion will have to adapt.
I did some digging and it seems newer versions of the LSP do not use apps.json anymore, and only write to the new sqlite3 database. Other apps like codecompanion will have to adapt.
Activity
[-]~/.config/github-copilot/hosts.json not created/saved even though authentication succeeds[/-][+]~/.config/github-copilot/apps.json not created/saved even though authentication succeeds[/+]PerMalmberg commentedon May 27, 2026
@lebedov Did you happen to find the cause of this? I'm experiencing the same, but in copilot.lua zbirenbaum/copilot.lua#706
lebedov commentedon May 27, 2026
Alas, no. I noticed that it only seems to happen on Linux, but not on MacOS with the exact same Neovim, copilot.vim, and NodeJS versions.
PerMalmberg commentedon May 27, 2026
Hm, I get it on both macOS and Linux, all the same config and node versions.
cainsusk commentedon Jun 4, 2026
Yea I can confirm I am having the same issue on MacOS
lebedov commentedon Jun 5, 2026
I asked Github Copilot to analyze the copilot.vim codebase and investigate why auth.db might exist without apps.json. Here is what it found:
I'm not setting XDG_CONFIG_HOME or any of the *TOKEN env variables on my system, so I don't think those are the causes of the problem. Some of the other comments, though, make me wonder whether one of the other plugins I have installed is interfering with copilot.vim. Will try disabling everything except copilot.vim, codecompanion.nvim, and related dependencies and see what happens.
karimaharyouli47-hash commentedon Jun 10, 2026
AntoineGS commentedon Jun 10, 2026
I did some digging and it seems newer versions of the LSP do not use apps.json anymore, and only write to the new sqlite3 database.
Other apps like codecompanion will have to adapt.
lebedov commentedon Jun 19, 2026
Submitted a PR for codecompanion to address this.