Uh oh!
There was an error while loading. Please reload this page.
feat: warning component to reduce bug when it has large context or token - #2971
feat: warning component to reduce bug when it has large context or token#2971samhvw8 wants to merge 1 commit into
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
a1fcf26Comparecte
commented
Apr 26, 2025
Very cool! Will take a look today. |
sachasayan
commented
Apr 28, 2025
samhvw8
commented
Apr 29, 2025
@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 ? |
sachasayan
commented
Apr 29, 2025
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. :) |
a1fcf26 to
0fb1454Comparesamhvw8
commented
Apr 30, 2025
@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
2fe0196Compare@mrubens update my pr, move config to per profile setting, can disable with switch or manual set to -1 |
e12425a to
c2efb54Compare5377555 to
938fe3fComparesachasayan
commented
May 6, 2025
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. |
mrubens
commented
May 6, 2025
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. |
mrubens
commented
May 6, 2025
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 |
samhvw8
commented
May 6, 2025
Later we can show for them both compact and start new chat option ? |
938fe3f to
0c1a881Compare8f47806 to
94c755fCompare@sachasayan@cte@mrubens what do you think about this ? ![]() https://www.loom.com/share/cbbeb3d93bfb4e918140da2663bf5601?sid=bbb221e6-a52b-4927-beea-cdea0d0b49b2 |
9b9fdb6 to
f1ee625Comparef1ee625 to
b981a33Comparemrubens
commented
May 15, 2025
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... |
samhvw8
commented
May 15, 2025
@mrubens ok so i just close this pr for now |
canrobins13
commented
May 16, 2025
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.