Fix: Copilot provider auth login compatibility - #3192
Conversation
…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
|
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").
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 |
Closes #3121 and maybe some others idk.
It actually just looks at that sqlite
.dbfile 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
rbbinary 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
to the superset
All, instead, because the current stylua version doesnt work with it.But running typechecking works, tests passing too!
Also works in
nvimfine and dandy, when putting in myghbranch in avante.lua