Add context window limit notification system #1068
Open
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