-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cody: fix error notification display pattern for rate limit #51521
Conversation
How does moving the error message to the chat view resolve the issue you mentioned? Wouldn't it just move the problem to somewhere else? What happens if the sidebar is closed even? There are two further improvements I had:
|
I think the immediate problem was that the error message persisted and get fired repeatedly as a system message, which is against the VS Code Guideline (we got called out by MS before so wanted to be caution about using the notification 😅 )
Yea that's a good point! What do you think about using https://code.visualstudio.com/api/ux-guidelines/status-bar
Why does it need to be repeated? 🤔 Also, in the user's case, they were getting the daily quota pop-up while using the chat and not completion. What do you think? |
Yeah, 100% agree that this is a bad pattern. But if we show it in the sidebar, we also show it repeatedly, no?
Idk I’m not a big fan of the status bar, I always have it disabled. 😅
It resets after a while and then on the next day the quota can be hit again. Maybe we can even parse the timestamp in the message and hide it until that time.
Hm but don't we render the error message in the chat view already? I feel like I have seen screenshots about this. It also looks from the code that your PR does not address this if the error pops up in the chat and not completion. |
Yes, but we have more control over it, and it won't be spamming their VS Code with notifications that would cause users to disable Cody as a result. because they can just keep the sidebar closed when Cody is down?
When they send a message while being out of the quote, they will get an error message from Cody to remind them that their limit is hit, yes.
Right! So that's the second issue --if you don't like the status bar and want to stay with the system pop-up, i think limiting it to once per day (about quote hit) will be less annoying than then getting reminded of something that's not working every hour. We should also add the |
Fair, this makes sense yeah.
Haha I’m not the definitive authority here, if you think the status bar would be better, I am all for it, just wanted to share my point of view :) Definitely agree on the once per day message though, 100% that we need this somehow. "Don't show again" would also be really cool if that's possible? |
Haha right? And there's so many widgets competing for attention too. Hiding it is bliss |
@philipp-spiess i've updated the PR to address the second issue by limiting the error for rate limit to show ever 6 hours when true, do you think it's fair? Video: https://www.loom.com/share/89301ada6b2d488cad24aa879201d0fc |
@@ -103,6 +103,26 @@ const register = async ( | |||
await chatProvider.executeRecipe(recipe, '') | |||
} | |||
|
|||
const webviewErrorMessager = async (error: string): Promise<void> => { | |||
if (error.includes('rate limit')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do this for now so we can ship a fix for this soonish (can you get to that today to also include your slash commands? otherwise we can do it on monday)
but long term I think we should do an overhaul of the error handling so that we don't have an rate limit error wrapped in a json syntax parsing error wrapped in a generic error and have to rely on the error message 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should do an overhaul of the error handling
100% LOL Thanks for the quick review btw, did this with Cody completions and 🤯
RE https://sourcegraph.slack.com/archives/C052G9Y5Y8H/p1683290207798969?thread_ts=1683288519.959009&cid=C052G9Y5Y8H
Issue:
Proposed solution:
This PR moves the error message to UI as a banner in chatview to address the pinpoint of getting a system popup repeatedly where the only solution is to disable Cody
Issue: Users who are not on Chat view will not be notified that they have hit the quota when their sidebar is closed
Solution: Display as error notification 4 time per day max (every 6 hours) and allow user to opt out from the notification
Edit: Updated for clarity.
Test plan