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
- Remove redundant id field from ExperimentConfig interface
- Update UI components to use experiment keys directly
- Improve type safety by using key-based mapping instead of object values
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
Add the ability to configure automatic mode switching approval in the Settings UI.
Implementation:
- Added alwaysAllowModeSwitch checkbox in the Auto-Approve Settings section
- Added state management integration with useExtensionState
- Added vscode.postMessage handler for state updates
- Placed the setting logically between MCP tools and execute operations settings
The new setting allows users to:
- Enable/disable automatic approval of mode switching operations
- Configure mode switching approval independently of other auto-approve settings
- Maintain consistent UX with other auto-approve settings
This completes the mode switching auto-approval feature, working in conjunction with:
- Previously added state management in ExtensionStateContext
- Core logic changes in ClineProvider
- WebviewMessage type updates
- Existing test coverage in ChatView.auto-approve.test.tsx
Implements automatic approval for mode switching operations when enabled, following
existing auto-approval patterns in the codebase.
Implementation:
- Added `alwaysAllowModeSwitch` to state management
- Updated `isAutoApproved` function in ChatView to handle mode switch requests
- Added mode switch option to AutoApproveMenu with appropriate handler
- Integrated with existing auto-approval flow
Tests:
- Added three test cases in ChatView.auto-approve.test.tsx:
1. Verifies mode switch auto-approval when enabled
2. Verifies no auto-approval when mode switch setting is disabled
3. Verifies no auto-approval when global auto-approval is disabled
The implementation follows existing patterns for other auto-approve features
(read, write, browser, etc.) to maintain consistency in the codebase.
- Add contextTokens to ApiMetrics interface
- Calculate context size using last API request's tokens
- Display context token count in TaskHeader below total tokens
- Use exact token counts instead of character estimation
This helps users track the total size of their conversation context,
which is useful for managing context window limits.
- 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
- Rename codeActionPrompt to supportPrompt for better clarity
- Move enhance prompt functionality into support prompts system
- Add ENHANCE tab alongside other support prompt types
- Update UI to show enhancement configuration in ENHANCE tab
- Update tests to reflect new unified structure
This change simplifies the prompt system by treating enhancement as another type of support prompt rather than a separate system.
- Move code action prompts from core/prompts to shared/support-prompt
- Migrate enhance prompt functionality from modes to support-prompt
- Add UI for managing code action prompts in PromptsView
- Update types and interfaces for better prompt management
- Add openAiUseAzure flag to force Azure OpenAI client initialization
- Add "Use Azure" checkbox in API settings UI
This change improves Azure OpenAI configuration flexibility by allowing users to explicitly opt-in to Azure client, regardless of the base URL pattern.