feat(context-window-monitor): add progressive warnings at 50%, 60%, 70%, 80%#1333
Open
taetaetae wants to merge 1 commit intocode-yeongyu:devfrom
Open
feat(context-window-monitor): add progressive warnings at 50%, 60%, 70%, 80%#1333taetaetae wants to merge 1 commit intocode-yeongyu:devfrom
taetaetae wants to merge 1 commit intocode-yeongyu:devfrom
Conversation
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 4/5
- This PR looks safe to merge with low risk; the single issue is moderate severity (4/10) and mainly affects warning ordering rather than core functionality.
- In
src/hooks/context-window-monitor.ts, skipped thresholds can lead to lower-urgency warnings firing after a critical warning, which may confuse users monitoring usage levels. - Pay close attention to
src/hooks/context-window-monitor.ts- threshold notification order and backfilled warnings.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/hooks/context-window-monitor.ts">
<violation number="1" location="src/hooks/context-window-monitor.ts:122">
P2: Only the highest threshold is marked as notified, so if usage skips thresholds (e.g., 40% → 80%), subsequent runs will emit lower-urgency warnings after the critical warning. This creates out-of-order backfilling of alerts and likely defeats the intended progressive warning behavior.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
da08a63 to
0706e36
Compare
d52d829 to
1584137
Compare
Author
|
Thanks @cubic-dev-ai for catching this issue! Fixed in the latest commit - now when a threshold is triggered, all lower thresholds are also marked as notified. This prevents out-of-order warnings when usage jumps (e.g., 40% → 80%). |
…0%, 80% - Replace single 70% threshold with progressive warnings - Add ANSI color coding for visual urgency (blue → yellow → orange → red) - Track notified thresholds per session to avoid duplicate alerts - Mark all lower thresholds as notified to prevent out-of-order warnings - Each threshold triggers once with appropriate urgency level: - 50% INFO: checkpoint notification - 60% NOTICE: awareness notification - 70% WARNING: caution notification - 80% CRITICAL: urgent action needed
1584137 to
a0ded61
Compare
0WD0
pushed a commit
to 0WD0/oh-my-opencode
that referenced
this pull request
Feb 1, 2026
leoisadev1
pushed a commit
to leoisadev1/oh-my-opencode
that referenced
this pull request
Feb 3, 2026
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
Add stepped context window warnings instead of a single 70% threshold notification.
Changes
Motivation
Previously, users only received a single notification at 70% context usage. By the time they noticed, it was often too late to wrap up work before hitting the 80%+ limit where sessions can become unresponsive.
With progressive warnings, users get early awareness (50%, 60%) and can plan accordingly, with increasingly urgent notifications as context fills up.
Testing
bun run typecheckpassesbun run buildsucceedsScreenshots
N/A (terminal color output)
Summary by cubic
Replace the single 70% context alert with progressive warnings at 50%, 60%, 70%, and 80% to give earlier, clearer signals. Adds color-coded urgency and triggers each level only once per session.
Written for commit a0ded61. Summary will update on new commits.