-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Condense Context] Track metrics around context condensing and show in UI #3736
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
603d2ef
[Condense Context] Track metrics around context condensing and show i…
canrobins13 95bd6cb
Add UI component
canrobins13 65f7f35
account for system prompt when estimating new context size
canrobins13 585023a
add header
canrobins13 2bdd7d1
bug fix
canrobins13 f4a263d
nit
canrobins13 0fb8075
nit
canrobins13 7053547
refactor
canrobins13 7c3f799
fix
canrobins13 9765612
add unit tests for condense
canrobins13 01bdc53
update sliding-window tests
canrobins13 a028f72
add getApiMetrics.test.ts
canrobins13 599e1c3
fix failing tests
canrobins13 fe883e3
use chat.json
canrobins13 5318a2f
add translations
canrobins13 bc94dba
add tests for ContextCondenseRow
canrobins13 ff56aba
add changeset
canrobins13 29e055c
camelCase
canrobins13 1f30149
use Markdown for summary
canrobins13 671c3b7
use tailwind
canrobins13 a1a8654
non default export
canrobins13 7df703f
rm test :/
canrobins13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "roo-cline": patch | ||
| --- | ||
|
|
||
| Shows in the UI when the context is intelligently condensed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
Hey @canrobins13,
Just a question about the
truncateConversationIfNeededfunction insliding-window:When
autoCondenseContextis true and the token limit is hit, it tries to summarize. But ifsummarizeConversationdecides not to create a summary (maybe because there aren't many new messages or there was a recent summary), it looks liketruncateConversationIfNeededstill goes ahead and does the simple truncation.I am aware this behavior was present before your changes, but would it make more sense to use the previous summary considering it might still be fresh rather than using the simple truncation?
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.
When making an API request we only send messages starting from the latest summary if one exists, so the recent summary message would be "used" in the case you highlighted (when making API requests and when calculating the context window usage).
This case should be pretty hard to hit through the existing implementation, but will be more relevant because we're about to add a button for manually triggering context summarization through the UI.
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.
Makes sense, if the condense feature becomes manual and the user clicks summarize multiple times, would this trigger the simple truncation? Or is it only triggered when the context is already bigger than the window?
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.
It's not implemented yet, but we wouldn't trigger simple truncation or dropping of messages from the user button, that would only hit the new condense code