You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent context condensing on settings save when provider/model unchanged
Fixes#4430
The issue was that saving settings during an active task would unconditionally rebuild the API handler in both upsertProviderProfile and activateProviderProfile, even when the provider and model hadn't changed. This caused transient changes to model metadata (contextWindow, maxTokens) which triggered the allowedTokens fast-path in context condensing logic, causing immediate condensing regardless of the configured threshold.
Changes:
- Added guard in upsertProviderProfile to only rebuild API handler when provider OR model changes
- Added guard in activateProviderProfile to only rebuild API handler when provider OR model changes
- Added comprehensive test suite to verify handler is not rebuilt unnecessarily
This prevents the "condense on save" behavior reported in issue #4430 while still rebuilding the handler when genuinely needed (provider or model change).
0 commit comments