Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Apr 26, 2025

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

before after
image

Screen cast

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.

  • Behavior:
    • Adds TokenUsageWarning component in ChatView.tsx to alert users when context or token usage exceeds thresholds.
    • Introduces warningThreshold settings in ClineProvider.ts and webviewMessageHandler.ts to manage warning thresholds.
  • UI Components:
    • New TokenUsageWarning.tsx component for displaying warnings and allowing users to start a new task.
    • Updates ContextManagementSettings.tsx to include WarningThresholdSettings.
  • Localization:
    • Updates localization files for multiple languages to include new warning messages and settings descriptions.
  • Misc:
    • Adds warningThresholdSchema in schemas/index.ts for validation.
    • Updates ExtensionMessage.ts and WebviewMessage.ts to handle new warning threshold messages.

This description was created by Ellipsis for efc71f27d1a219fc15681a10c9a062def77c567e. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Apr 26, 2025

⚠️ No Changeset found

Latest commit: b981a33

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 26, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 26, 2025

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.

@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch 2 times, most recently from db93d99 to a1fcf26 Compare April 26, 2025 16:33
@cte
Copy link
Collaborator

cte commented Apr 26, 2025

Very cool! Will take a look today.

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 28, 2025
@sachasayan
Copy link
Contributor

Would suggest playing around with a TaskHeader placement... :)

Screenshot 2025-04-28 at 7 17 05 PM

@samhvw8
Copy link
Contributor Author

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 ?

image

@sachasayan
Copy link
Contributor

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. :)

Copy link
Collaborator

@mrubens mrubens left a 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?

@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch from a1fcf26 to 0fb1454 Compare April 30, 2025 02:58
@samhvw8
Copy link
Contributor Author

samhvw8 commented Apr 30, 2025

@mrubens

  • for default value i think context window: 75%, total token (input tokens + output token): 5_500_000, cost: 3$
  • for Should this setting be model specific: for total token may be we need model specific
  • When it starts a new task, does that boomerang back when it’s done?: i think we don't need to boomerang back

@sachasayan after dismiss should we make it show up again when user meet 1-2 consecutive error ?

@mrubens
Copy link
Collaborator

mrubens commented Apr 30, 2025

@mrubens

  • for default value i think context window: 75%, total token (input tokens + output token): 5_500_000, cost: 3$
  • for Should this setting be model specific: for total token may be we need model specific

Yeah, total tokens does seem like it would need to be model specific. Same thing with cost, I think.

  • When it starts a new task, does that boomerang back when it’s done?: i think we don't need to boomerang back

Right now every new_task will boomerang back right?

@samhvw8
Copy link
Contributor Author

samhvw8 commented Apr 30, 2025

Yeah, total tokens does seem like it would need to be model specific. Same thing with cost, I think.

should we move all into provider config or just total + cost ?

Right now every new_task will boomerang back right?

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 ?

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 4, 2025
@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch from 741488b to 2fe0196 Compare May 4, 2025 10:50
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels May 4, 2025
@samhvw8
Copy link
Contributor Author

samhvw8 commented May 4, 2025

@mrubens update my pr, move config to per profile setting, can disable with switch or manual set to -1

@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch 2 times, most recently from e12425a to c2efb54 Compare May 4, 2025 15:44
@mrubens mrubens assigned mrubens and unassigned mrubens May 5, 2025
@github-project-automation github-project-automation bot moved this from PR [Greenlit] to Done in Roo Code Roadmap May 6, 2025
@samhvw8 samhvw8 reopened this May 6, 2025
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap May 6, 2025
@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch from 5377555 to 938fe3f Compare May 6, 2025 10:59
@hannesrudolph hannesrudolph moved this from New to PR [Greenlit] in Roo Code Roadmap May 6, 2025
@sachasayan
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

@samhvw8
Copy link
Contributor Author

samhvw8 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.

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
Copy link
Contributor Author

samhvw8 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.

Later we can show for them both compact and start new chat option ?

@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch from 938fe3f to 0c1a881 Compare May 9, 2025 08:21
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 9, 2025
@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch 2 times, most recently from 8f47806 to 94c755f Compare May 10, 2025 11:05
@samhvw8
Copy link
Contributor Author

samhvw8 commented May 10, 2025

@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch 3 times, most recently from 9b9fdb6 to f1ee625 Compare May 12, 2025 23:18
@samhvw8 samhvw8 force-pushed the feat/banner-create-new-task branch from f1ee625 to b981a33 Compare May 14, 2025 14:36
@mrubens
Copy link
Collaborator

mrubens 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 samhvw8 closed this May 15, 2025
@github-project-automation github-project-automation bot moved this from PR [Greenlit] to Done in Roo Code Roadmap May 15, 2025
@samhvw8
Copy link
Contributor Author

samhvw8 commented May 15, 2025

@mrubens ok so i just close this pr for now

@canrobins13
Copy link
Contributor

Thanks for the inspo here! We added some version of this in #3582, which you can enable with the autoCondenseContext experimental feature.
Some follow up features are tracked in these issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants