-
Notifications
You must be signed in to change notification settings - Fork 298
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
Autocomplete: Expose rate limiting and other errors to users #634
Comments
@eseliger @philipp-spiess I've done a bit of testing locally with adding an additional icon, or seeing if it's possible to do the split/two-button style (it doesn't appear to be possible), and landed exactly back at what you suggested: (This is from a slightly new design than what's on main, so please ignore the slightly different statusbar label and quickpick items) Use the current icon, change the background and tooltip, and add an item to the top of the quickpick (selected, with a separator below). @eseliger How does the rate limiting logic work? And what error message/info do we have available to show? An example of whatever string the backend spits out that we'd show to the user could do, just so I can sanity check it with reality. As far as docs go, I found https://docs.sourcegraph.com/cody/explanations/cody_gateway#rate-limits-and-quotas — should we update it while we're here? |
You will get 429 HTTP errors when making requests while throttled, with headers that tells when the limit resets and so forth:
They can do:
|
Thanks! In that case, I think the UI should probably just say "Retry again in {friendlyTimeDuration}" type thing (e.g. "Retry again in 2 minutes") — but in the documentation we can have that information for how to request a limit increase. What are the time buckets? 1 minute? |
For the doc update:
Is there a specific channel/person/group they should talk to? Does that also apply to sourcegraph.com users? |
The buckets are 24 hours. And I think for autocomplete, retry is not really a useful term since the code change was likely already made. For that feature, we should say something like "Autocomplete will be available again in {friendlyTimeDurationi}. {Some CTA} now to increase your quota" or so. |
Thanks @philipp-spiess, will update. (Is anyone hitting this on their first day of use? That's a long time to wait…) |
Note that this is instance-wide, so for enterprise customers with 500 licensed users, all 500 combined have to on average use the per-user allocated number of requests.
Not sure, @jdorfman usually handles these I think.
Yes, dotcom and app :) |
Thanks @eseliger, will get a design & docs update ready. It might be a nice improvement to reduce the bucket duration to 30min at some point… 24h seems a bit unfriendly (it's more like a 1 day ban than a rate limit). |
While our rate limits depend on requests made, not spend incurred on our end or so, and because we don't have rollover in additional windows, using a 1h window might actually make it worse for most of our customers, because:
For an instance of 5000 users that can do 1000 requests per user per day, that means: All users combined can make 5M requests in a 24h window Now, when the work day starts and everyone's hacking away happily, they might want to burn through their 24h limit in the 8h of their workday. With the 24h window, they get all their 5M permitted requests during the work day. If it was an hourly window, they would only get to use 1/3 of that during their working hours. There's more changes coming to billing here likely as we get closer to GA, do you think we need to revisit this before then? Ideally, 95%+ of users should not hit their limits, at least not enterprise users, those numbers were chosen carefully that most people get through the day without interruptions, favoring user experience, while keeping cost incurred fair. |
Thanks for getting me up to speed. The Enterprise case makes sense as is. I think we'd only need to revisit if we see that free users are hitting it during their first days of use, and getting stuck for a whole day. |
Here's an updated design, based on those words @philipp-spiess, and I reckon this is good to go: Give it's a single line, I've left off the CTA in the text, and assume they'll discover to click the item and read the docs page. |
(I don't love "notice" either — suggestions welcome!) |
Users usually just drop a message in |
I think we should probably work on this sooner rather than later. Dotcom users are getting hit by this and are confused: https://github.com/sourcegraph/cody/discussions/660 @toolmantim Is this ready to be taken over from your side? 🙂 |
Yeah this is good to go @philipp-spiess! |
Closes #634 This PR adds a UI indicator for autocomplete errors. We special case rate limiting errors to provider more information. - When a rate limit error is encountered, we show it only once per rate limit interval (the UI indicator will reset with a VS Code restart). When the option is selected in quick pick, we open https://about.sourcegraph.com/blog/increasing-the-completions-rate-limit (the only resource I found that we have for rate limits) - When any other (e.g. a network error) is encountered, we show the error message and open the output channel. We also add a new `error` API similar to the `debug` one but that will always log errors to the output channel. ## ToDo - [x] Add a new `error` API similar to the `debug` one but that will always log errors to the output channel. - [x] Add test cases ## Test plan https://github.com/sourcegraph/cody/assets/458591/efa5f660-706e-47db-96e1-63b5f7b2d2fc <!-- Required. See https://docs.sourcegraph.com/dev/background-information/testing_principles. --> --------- Co-authored-by: Tim Lucas <t@toolmantim.com>
There are some rate limits in place, both for chats and autocomplete. For chat, we display error messages in the transcript, so users know that their chat message failed because of rate limit exhaustion. But for autocomplete, we give no visible feedback.
We need to:
From @eseliger’s Slack message:
The text was updated successfully, but these errors were encountered: