-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: warning component to reduce bug when it has large context or token #2971
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
Conversation
|
|
This pull request includes a large number of changes across different areas of the codebase. To improve reviewability and maintain focus, it would be beneficial to split the localization changes into a separate pull request. This way, the core functionality changes related to the warning component can be reviewed independently from the localization updates. Please consider creating a separate pull request for the localization changes, which include updates to the i18n files for various languages. |
db93d99 to
a1fcf26
Compare
|
Very cool! Will take a look today. |
|
@sachasayan i get inspired from claude chat, i think they put near chat area to make UX better when your drag mouse into it, should we can add dismiss / close button like them ? |
|
Okay, I'm fine with it where it is. Yes, I'd say let's add a dismiss/close button and let's ship. We can do a styling refinement pass later. :) |
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.
I think we should probably discuss a little more before shipping. On my phone, but some questions that come to mind:
What are the defaults? Should this setting be model specific? When it starts a new task, does that boomerang back when it’s done?
a1fcf26 to
0fb1454
Compare
@sachasayan after dismiss should we make it show up again when user meet 1-2 consecutive error ? |
Yeah, total tokens does seem like it would need to be model specific. Same thing with cost, I think.
Right now every new_task will boomerang back right? |
should we move all into provider config or just total + cost ?
yeah, let make an follow up pr that can allow new_task had option to not return parent task ? and default will be return to parent ? |
741488b to
2fe0196
Compare
|
@mrubens update my pr, move config to per profile setting, can disable with switch or manual set to -1 |
e12425a to
c2efb54
Compare
5377555 to
938fe3f
Compare
|
Hey @samhvw8 I think we've chatted about this one and we're not quite sure about where the thresholds should be + it needs some UI polish. Those are the two big outstanding issues right now. |
|
I think there’s also the issue that all new tasks are subtasks currently. Seems like we also need to figure out what to do about that. |
|
Restated - what’s the action that we want the user to take when we warn them about the context? I think this could make a lot of sense if paired with a smol/compact action for instance, but would love to have a clear opinion on that. |
From @mrubens i move it to api profile For Ui polish, can you help me and push commit direct to this pr ? I will try to make it can dismis |
Later we can show for them both compact and start new chat option ? |
938fe3f to
0c1a881
Compare
8f47806 to
94c755f
Compare
|
@sachasayan @cte @mrubens what do you think about this ?
https://www.loom.com/share/cbbeb3d93bfb4e918140da2663bf5601?sid=bbb221e6-a52b-4927-beea-cdea0d0b49b2 |
9b9fdb6 to
f1ee625
Compare
f1ee625 to
b981a33
Compare
|
I'm curious to see how #3582 plays out. If it works well, we may not need this from a cost/context management perspective. Though the PR description focuses more on client-side performance... |
|
@mrubens ok so i just close this pr for now |
|
Thanks for the inspo here! We added some version of this in #3582, which you can enable with the |



Context
Some user has black screen or gray screen due to has very large chat conversation (input token: 30 mil, 70 mil, 200 mil)
Implementation
Create new element that warning user when excess threshold, show it to user
Screenshots
Screen cast
Warning Long Chat Conversation - Watch Video
How to Test
Get in Touch
Important
Introduces a warning component to alert users when chat context or token usage exceeds thresholds, with updates to UI components, settings, and localization files.
TokenUsageWarningcomponent inChatView.tsxto alert users when context or token usage exceeds thresholds.warningThresholdsettings inClineProvider.tsandwebviewMessageHandler.tsto manage warning thresholds.TokenUsageWarning.tsxcomponent for displaying warnings and allowing users to start a new task.ContextManagementSettings.tsxto includeWarningThresholdSettings.warningThresholdSchemainschemas/index.tsfor validation.ExtensionMessage.tsandWebviewMessage.tsto handle new warning threshold messages.This description was created by
for efc71f27d1a219fc15681a10c9a062def77c567e. You can customize this summary. It will automatically update as commits are pushed.