-
Notifications
You must be signed in to change notification settings - Fork 1.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
base: main
Are you sure you want to change the base?
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. |
- 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
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 |
- 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
|
@@ -389,6 +390,13 @@ | |||
"maxConcurrentFileReads": { | |||
"label": "Limit jednoczesnych odczytów", | |||
"description": "Maksymalna liczba plików, które narzędzie 'read_file' może przetwarzać jednocześnie. Wyższe wartości mogą przyspieszyć odczyt wielu małych plików, ale zwiększają zużycie pamięci." | |||
}, | |||
"condensingThreshold": { |
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.
New translation keys (in the condensingThreshold
object) are added for profile‐specific context condensing thresholds, but the values remain in English. Please provide Polish translations to ensure a consistent localized experience.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
@@ -389,6 +390,13 @@ | |||
"maxConcurrentFileReads": { | |||
"label": "Лимит одновременного чтения", | |||
"description": "Максимальное количество файлов, которые инструмент 'read_file' может обрабатывать одновременно. Более высокие значения могут ускорить чтение нескольких небольших файлов, но увеличивают использование памяти." | |||
}, | |||
"condensingThreshold": { |
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.
The 'condensingThreshold' block in the Russian translation remains in English. Please provide proper Russian translations for these keys to maintain consistency.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
@@ -389,6 +390,13 @@ | |||
"maxConcurrentFileReads": { | |||
"label": "Eşzamanlı dosya okuma sınırı", | |||
"description": "'read_file' aracının aynı anda işleyebileceği maksimum dosya sayısı. Daha yüksek değerler birden çok küçük dosyanın okunmasını hızlandırabilir ancak bellek kullanımını artırır." | |||
}, | |||
"condensingThreshold": { | |||
8000 | "label": "Context Condensing Threshold", |
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.
The new condensingThreshold
keys in the Turkish translation are still in English. Please update them with Turkish translations.
"label": "Context Condensing Threshold", | |
"label": "Bağlam Yoğunlaştırma Eşiği", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
@@ -389,6 +390,13 @@ | |||
"maxConcurrentFileReads": { | |||
"label": "Giới hạn đọc file đồng thời", | |||
"description": "Số lượng file tối đa mà công cụ 'read_file' có thể xử lý cùng lúc. Giá trị cao hơn có thể tăng tốc độ đọc nhiều file nhỏ nhưng sẽ tăng mức sử dụng bộ nhớ." | |||
}, | |||
"condensingThreshold": { |
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.
The 'condensingThreshold'
translation keys in the Vietnamese file are in English. Please update them with appropriate Vietnamese translations.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
@@ -389,6 +390,13 @@ | |||
"maxConcurrentFileReads": { | |||
"label": "並行檔案讀取限制", | |||
"description": "read_file 工具可以同時處理的最大檔案數。較高的值可能會加快讀取多個小檔案的速度,但會增加記憶體使用量。" | |||
}, | |||
"condensingThreshold": { |
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.
The condensingThreshold
keys in the Traditional Chinese file are not localized and remain in English. Please update them with appropriate Traditional Chinese translations.
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
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:
profileSpecificThresholdsEnabled
andprofileThresholds
to the global settings schemaProfileThresholdManager
for managing profile-specific configurations-1
threshold values to indicate using the default global thresholdWhat reviewers should focus on:
src/core/sliding-window/index.ts
for threshold resolutionvscode.postMessage
Test Procedure
Manual Testing:
-1
value to ensure it falls back to global thresholdAutomated Testing:
pnpm test
to execute all test suitesType of Change
src
or test files.Pre-Submission Checklist
npm run lint
).console.log
) has been removed.npm test
).main
branch.npm run changeset
if 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, allowing different settings per API profile, with UI and backend support.
sliding-window/index.ts
, allowing different thresholds per API configuration profile.-1
as a threshold value to use the global default.profileThresholds
toglobal-settings.ts
schema.ContextManagementSettings.tsx
to include UI for managing profile-specific thresholds.sliding-window.test.ts
for threshold logic and edge cases.ContextManagementSettings.test.tsx
to verify new settings behavior.ClineProvider.ts
andwebviewMessageHandler.ts
for state synchronization.This description was created by
for a850d4d. You can customize this summary. It will automatically update as commits are pushed.