-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add profile-specific context condensing thresholds #4456
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
feat: add profile-specific context condensing thresholds #4456
Conversation
|
this is cool, since each model has difference context window and effective context window, this will be crucial pr feature :D |
|
What do you think of something like this where we just migrate them to all be profile-specific: #2655? Not sure we need a checkbox for this. |
I initially considered that placement. However, I've positioned this setting alongside the other auto-condensing options for a couple of reasons: it's directly related to that function, and it becomes irrelevant if auto-condensing is disabled. |
|
I actually think the best approach might be to put a profile selector dropdown above the threshold slider in my screenshot, the same as what we have in the section below. So you're configuring "Default" by default, but can choose another. |
Good call |
|
|
|
Hey @SannidhyaSah, Can you take a look at the conflicts? |
2b03d0d to
b4cdd84
Compare
daniel-lxs
left a comment
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.
Took a while but the conflicts are solved
|
Is the test failure legit? |
59d504d to
c82d9d5
Compare
- Remove emoji from info text and use codicon instead - Restructure layout to vertical stack for better spacing - Position Save button on far right using justify-between - Apply consistent styling with other settings sections - Update tests to match hardcoded info text
- Simplified context management settings by removing ProfileThresholdManager - Updated global settings types and core sliding window logic - Modified webview message handlers and extension state context - Updated all locale files for settings translations - Removed ProfileThresholdManager component and related tests - Updated ContextManagementSettings and SettingsView components
- Add profileThresholds to ExtensionState type definition - Add profileThresholds prop to ContextManagementSettings component - Add profileThresholds message type to WebviewMessage - Remove invalid useEffect dependency on undefined currentProfileId - Pass profileThresholds prop from SettingsView to ContextManagementSettings
- Add default empty object for profileThresholds to ensure it's never undefined - This resolves the TypeScript error where optional profileThresholds from ExtensionState was incompatible with required profileThresholds in ExtensionStateContextType
- Fixed failing test that incorrectly expected condensing-related UI elements to be present when autoCondenseContext is false - Updated test to properly assert that condensing API configuration and custom prompt elements are not in the document when auto condense is disabled - This aligns the test with the actual component behavior which correctly hides these elements when autoCondenseContext is false
…ultiple languages
c82d9d5 to
0c3b3b4
Compare
|
@mrubens |
Co-authored-by: Daniel Riccio <[email protected]> Co-authored-by: Matt Rubens <[email protected]>


Related GitHub Issue
Related to: #4342 and Closes #4118
Description
This PR implements profile-specific context condensing thresholds, addressing one of the context management improvements outlined in issue #4342 (It also closes #4118) . This feature allows users to configure different automatic threshold percentages for intelligent context condensing based on their API configuration profiles. Previously, there was only a single global threshold that applied to all profiles, which was inefficient since different LLM models have varying context window sizes.
Key implementation details:
profileSpecificThresholdsEnabledandprofileThresholdsto the global settings schemaProfileThresholdManagerfor managing profile-specific configurations-1threshold values to indicate using the default global thresholdWhat reviewers should focus on:
src/core/sliding-window/index.tsfor threshold resolutionvscode.postMessageTest Procedure
Manual Testing:
-1value to ensure it falls back to global thresholdAutomated Testing:
pnpm testto execute all test suitesType of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Before: Only global threshold setting available
After: New profile-specific threshold management UI with:
Documentation Updates
Additional Notes
This feature significantly improves the user experience for users working with multiple LLM models that have different context window sizes. The implementation maintains backward compatibility - existing users will continue to use the global threshold until they explicitly enable profile-specific thresholds.
The UI design follows the existing patterns in the settings panel and includes proper internationalization support with translation keys added to the English locale file.
This PR addresses one aspect of the context management improvements discussed in issue #4342. Additional PRs may be needed to fully address all the concerns raised in that issue.
Get in Touch
Discord: Lews
Important
Adds profile-specific context condensing thresholds, enhancing context management flexibility and efficiency with new settings, UI components, and comprehensive testing.
sliding-window/index.ts, allowing different thresholds per profile.profileSpecificThresholdsEnabledandprofileThresholdsto settings schema inglobal-settings.ts.-1as a threshold value to use the global default.ProfileThresholdManagercomponent inContextManagementSettings.tsxfor managing profile-specific thresholds.sliding-window.test.tsfor threshold logic and edge cases.ContextManagementSettings.test.tsxto verify new component behavior.ClineProvider.tsandTask.tsfor state management and threshold application.This description was created by
for 7d3619603e288cb856ad0c9ce081232d6b7ffb37. You can customize this summary. It will automatically update as commits are pushed.