-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Optimize Token Caching to Prevent Copilot Rate Limiting Issues #736
Comments
The original oauth token is already cached, we are grabbing it from cache and then doing same thing as https://github.com/github/copilot.vim pretty much. We can cache the response from this request i guess but I never experienced this issue myself and havent seen anyone else with this issue using this plugin either so are you sure this plugin is the only thing you were using for accessing copilot when you got the abuse detection mail? |
Appreciate the response! 😊 Just to clarify: My setup uses copilot.lua which caches the OAuth token in ~/.config/github-copilot/apps.json. My theory: If we restart Neovim multiple times within a short period, each instance might be:
Could this repeated v2/token regeneration (even with the same OAuth token) look like suspicious burst traffic to GitHub's API? Totally get that this might be edge-case behavior! Just sharing my debugging journey as someone who compulsively restarts nvim 20 times a day 🫠 |
Yea I mean if its an issue we can always at least try to cache it. But one more thing I would verify is if it isnt copilot.lua issue, I am using copilot.vim and I would trust that one more than copilot.lua, can you reproduce this issue when using copilot.vim instead of lua? |
That's a valid question, but I'm hesitant to test with copilot.vim because:
I believe the core issue is unrelated to copilot.vim/lua implementations Not requesting immediate action - just documenting this pattern for others' reference. Appreciate your openness to consider cache adjustments! |
Currently, the token refresh mechanism only triggers on timeout. However, repeatedly opening/closing Neovim and sending a single request each time appears to result in Copilot API access restrictions (I've experienced 4 account suspensions, each occurring after this pattern).
I suspect this behavior might be triggering GitHub's abuse detection mechanisms due to frequent token reinitialization. To mitigate this, could we improve the caching logic to persist tokens more effectively across sessions?
Additionally, while less urgent, handling potential API concurrency (especially for chat requests) might further reduce edge-case risks. But this seems less critical compared to the token persistence issue.
The text was updated successfully, but these errors were encountered: