-
Notifications
You must be signed in to change notification settings - Fork 2
Context Window Management #64
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace provider-based compact generation with prompt-based approach. Compacting now sends a compact prompt as a regular message, allowing the conversation to handle it naturally with retries and error recovery. Key changes: - Remove generateCompact() from providers, use compact prompt instead - Add pending message queue to send messages after compacting completes - Show collapsible compact results with status indicators - Display auto-compact notice when context threshold approaches - Rename reducingContext to compacting for clarity - Add contextOverflow and contextLeftUntilAutoCompact getters - Remove contextWindow store (consolidated into chat store) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Use onError handler to track compaction failures instead of try-catch - Fix retry() to avoid double regeneration during compaction errors - Extract finishCompaction() helper for cleaner code flow - Improve context limit calculation to reserve 25% for models <128K tokens - Comment out expose property to fix vue-tsc compatibility issue Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #25
A metadata button that shows token count and used model
An auto-compact text that shows when the context limit is <= 15%
A new option to enable/disable auto-compact
New mock models for testing (in dev mode)
TODOs: