Add context window limit notification system#1068
Open
yurekami wants to merge 1 commit intodeepseek-ai:mainfrom
Open
Add context window limit notification system#1068yurekami wants to merge 1 commit intodeepseek-ai:mainfrom
yurekami wants to merge 1 commit intodeepseek-ai:mainfrom
Conversation
Implements a ContextTracker utility that provides: - Real-time token count tracking during conversations - Visual progress bar showing context window usage - Warning notifications at 75% and 90% thresholds - New commands: /context, /summary for user control - Summarization suggestions when approaching capacity This improves user experience by providing transparency about context limits and helping users manage long conversations. Closes deepseek-ai#1050 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
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.
Summary
Implements a context window limit notification system to improve user experience during long conversations. This directly addresses issue #1050.
Features Added:
ContextTracker utility class (
inference/context_tracker.py):New interactive commands:
/context- Display current context window usage/summary- Get a prompt to summarize the conversation/clearwith confirmation messageAutomatic notifications:
Example Output
At 75% capacity:
Test plan
python -m py_compile inference/context_tracker.py inference/generate.py/contextcommand displays usage stats/summarycommand shows summarization prompt/clearresets the context trackerCloses #1050
🤖 Generated with Claude Code