Display the percentage of total context window used alongside token count in the task header. This helps users better understand their context usage relative to the model's capacity.
Implementation details:
- Retrieve model's context window size from normalized API configuration
- Calculate percentage of context window used based on current context tokens
- Display percentage in parentheses next to token count (e.g. "40,000 (20%)")
- Default to context window size of 1 if model info is unavailable
- Format numbers with commas for better readability
Adds the current conversation's context token count to the environment details section by:
- Using existing getApiMetrics() to retrieve contextTokens from the last API request
- Adding a new "Context Tokens" section between "Current Time" and "Current Mode"
- Formatting the token count with toLocaleString() for better readability
- Showing "(Not available)" when no context tokens are present
This provides visibility into the current conversation's token usage directly in the environment details, helping track context window utilization.
Change ExperimentId type to be value-based rather than key-based
Make experiment record types more strict with proper typing
Pass full experiment config object instead of single boolean flag
Update type definitions and usages across codebase
- Add experiments.ts to manage experimental features
- Refactor experimental diff strategy into experiments system
- Add UI components for managing experimental features
- Add tests for experimental tools
- Update system prompts to handle experiments
- Rename customPrompts to customModePrompts for mode-specific prompts
- Add new customSupportPrompts type for support action prompts
- Update types to be more specific (CustomModePrompts and CustomSupportPrompts)
- Fix all related tests and component implementations
- Added `updateDiffStrategy` method to dynamically adjust the diff strategy based on the current state and experimental settings.
- Updated ClineProvider to call `updateDiffStrategy` when the experimental diff strategy is modified, ensuring real-time updates in the Cline instance.
- Added support for an experimental diff strategy in the Cline class, allowing users to opt for a new unified diff approach.
- Updated the getDiffStrategy function to accommodate the experimental strategy, adjusting the fuzzy match threshold accordingly.
- Integrated experimentalDiffStrategy into the global state management, enabling persistence across sessions.
- Enhanced the ClineProvider and related components to handle the new experimental strategy, including UI updates for user settings.
- Improved task history management to include the experimentalDiffStrategy setting, ensuring consistency in task execution.
- Updated relevant interfaces and types to reflect the new experimentalDiffStrategy property.
- Add requestDelaySeconds setting for configuring delay between retry attempts
- Add alwaysApproveResubmit option for automatic retry approval
- Add api_req_retry_delayed message type for delayed retries
- Update UI components to support new retry control settings