Skip to content

Conversation

@vanclute
Copy link

@vanclute vanclute commented Dec 9, 2025

Summary

Adds visual threshold warnings to context widgets to help users monitor context window usage and manage long conversations.

Features

  • 🟡 Yellow warning at configurable threshold (default: 120k tokens)
  • 🔴 Red critical at configurable threshold (default: 140k tokens)
  • Applies to Context Length and Context Percentage widgets
  • Fully configurable via settings.json

Configuration

{
  "tokenWarnings": {
    "enabled": true,
    "warningThreshold": 120000,
    "criticalThreshold": 140000,
    "showEmojis": true
  }
}

Why Context Warnings?

  • Helps stay aware of context window consumption
  • Useful for managing long conversations and avoiding auto-compact
  • Thresholds are personal preference - defaults (120k/140k) are starting points

Implementation

  • Shared utility function for consistent behavior across context widgets
  • Clean separation of concerns (settings → utility → widgets)
  • Backwards compatible (warnings enabled by default)
  • Tested locally with various threshold values

Closes #38

- Add threshold-based visual warnings to context widgets
- Yellow warning at 120k tokens (⚠️ + bold)
- Red critical at 140k+ tokens (🔴 + bold + background)
- Applies to Context Length and Context Percentage widgets
- Fully configurable via settings.json
- Options: enable/disable, custom thresholds, emoji toggle
- Shared utility function for consistent behavior
- Defaults (120k/140k) are starting points - users adjust to preference
- Helps manage context window usage and avoid auto-compact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dynamic color feature based on widget values

1 participant