Fix: Update hardcoded Claude 3.7 in compaction to respect user's model selection #3712
+135
−0
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.
Fix: Update hardcoded Claude 3.7 in compaction config to respect user's model selection
Issue
When chat context reaches 60% capacity, the compaction feature (which summarizes old messages) uses a hardcoded Claude 3.7 model instead of respecting the user's selected model. This causes:
Root Cause
File:
src/agent/agent-context/compaction/config.ts(compiled to extension.js:668866)Usage:
src/agent/agent-context/compaction/strategies/simple-strategy.ts(extension.js:699447)Proposed Fix
Option 1: Use User's Selected Model (Recommended)
Option 2: Update to Claude Sonnet 4.5 (Minimal Change)
Option 3: Use Haiku for Cost/Speed (Best for Compaction)
Patch File (for compiled extension.js)
Since the source code isn't public, here's a patch for the compiled extension.js:
Testing
Additional Improvements
While fixing this, consider:
Related Issues
Special thanks to @huachuman for the conspiracy theory about AWS secretly swapping models behind the scenes, which inspired a deeper investigation into the actual cause. Turns out it wasn't AWS - just a hardcoded string at line 668866. Much less exciting, but easier to fix.
References
analysisModeldefinitionanalysisModelusage in compactioncompactionThreshold: 0.6(60% trigger)