Skip to content

Fix: Copilot provider auth login compatibility - #3192

Open
viktorashi wants to merge 2 commits into
avante-corp:mainfrom
viktorashi:fix/copilot-compat
Open

Fix: Copilot provider auth login compatibility#3192
viktorashi wants to merge 2 commits into
avante-corp:mainfrom
viktorashi:fix/copilot-compat

Conversation

@viktorashi

@viktorashi viktorashi commented Aug 17, 2026

Copy link
Copy Markdown

Closes #3121 and maybe some others idk.

It actually just looks at that sqlite .db file and searches for the token (while keeping it backwards compatible).
As it's been seen in that issue' thread, some people have come up with workarounds in their personal dotfiles, but that kinda changes the architecture alltogather.

I've also put a little rb binary sqlite db file reading magic for whoever doesn't even have sqlite3 installed, but honestly you could probably revert that commit, it's not really essential and it looks pretty ugly, if you want you can just flash a message instructing the user to go and install sqlite instead.


Also (unrelated) I've ran CI from the contributing guidelines, but I think you guys need to update your

syntax = "Lua52"

to the superset All , instead, because the current stylua version doesnt work with it.

But running typechecking works, tests passing too!
Also works in nvim fine and dandy, when putting in my gh branch in avante.lua

istan added 2 commits August 17, 2026 15:32
…available

When sqlite3 is not in PATH (common on Windows), fall back to scanning
the raw database file and its WAL for the OAuth token prefix.  This
works with token_schema_version 0 where the blob is plaintext.

This commit is intentionally separate so maintainers can revert it
independently if the heuristic proves problematic.

Ref: yetone#3121
Copilot AI lite review requested due to automatic review settings August 17, 2026 13:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@teto

teto commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

thanks for the contribution. Can you add some logging statements to help users troubleshoot what's going on ("no results from sqlite", "scanning raw bytes").

to the superset All , instead, because the current stylua version doesnt work with it.

we target lua 5.1 so that should be the target thanks for noticing.

I've installed copilot-lua to try checking this PR and I can't say I have much confidence in the project. First of all a simple clone of the repo takes 1GB with stuff that should never be part of a git repo. I was looking if there was some API we could use instead of reimplementing their logic but seems like that logic is in javascript (with semiobfuscated code).

Can you explain to me what are the advantages of using copilot with avante ? How different it is from plain "copilot.lua" ?

I dont want to assign you another "PR tax" but if you feel like it, feel free to add a small help at the top of lua/avante/providers/copilot.lua explaining what it does at high level. I can in a follow up PR with the small details to generate :h avante-copilot section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Can not use copilot.vim for Copilot provider, recent versions dont create needed apps.json file

3 participants