Fixes #5229: Profile Condense Threshold not working #5271
Closed
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.
Summary
This PR fixes GitHub issue #5229 where profile-specific condensation thresholds were not working correctly.
Problem
When users set a condensation trigger threshold (e.g., 25%) for a specific profile in Settings->Context->Condensing Trigger Threshold, the automatic context condensation would not trigger at the specified threshold. Instead, it would fall back to the global threshold setting.
Root Cause
The bug was in
src/core/task/Task.tsat line 1724. The code was usingcurrentApiConfigName(which contains the profile name) as the key to lookup profile thresholds, but theprofileThresholdsobject is actually keyed by profile ID. This mismatch meant the profile-specific threshold was never found.Solution
listApiConfigMetato find the matching profile configuration and extract its IDChanges
truncateConversationIfNeededTesting
Closes #5229
Important
Fixes profile-specific condensation threshold lookup in
Task.tsby resolving profile ID correctly, with tests added to verify the fix.truncateConversationIfNeededinTask.tsby resolving profile ID from profile name.sliding-window.spec.tsto verify profile ID resolution and correct threshold application.This description was created by
for dc2b7d6. You can customize this summary. It will automatically update as commits are pushed.