Implements a more robust bundling strategy for Mermaid diagrams to prevent
dynamic chunk loading at runtime, which was causing CSP violations.
Key changes:
- Added manualChunks function in vite.config.ts to consolidate all Mermaid
code and dependencies into a single bundle
- Added mermaid and dagre to optimizeDeps.include for pre-bundling
- Customized chunkFileNames to ensure predictable output
- Removed incorrect static imports in MermaidBlock.tsx
This resolves the CSP errors where Mermaid was attempting to dynamically
load chunks like chunk-RZ5BOZE2.js and channel.js from the webview origin.
Fixes: #3680
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
* feat: Add OpenAI Compatible embedder for codebase indexing
- Implement OpenAiCompatibleEmbedder with batching and retry logic
- Add configuration support for base URL and API key
- Update UI with provider selection and input fields
- Add comprehensive test coverage
- Support for all OpenAI-compatible endpoints (LiteLLM, LMStudio, Ollama, etc.)
- Add internationalization for 17 languages
* fix: Update CodeIndexSettings tests for OpenAI Compatible provider
- Fix field count expectations (4 fields including Qdrant)
- Use specific test IDs for button selection
- Fix input handling with clear() before type()
- Use toHaveBeenLastCalledWith for better assertions
- Fix status text matching with regex pattern
* fix: resolve UI test failures and ESLint errors
- Remove unused waitFor import to fix ESLint error
- Fix test expectations to match actual component behavior for input fields
- Simplify provider selection test by removing complex mock interactions
- All CodeIndexSettings tests now pass (20/20)
* feat: add custom model infrastructure for OpenAI-compatible embedder
- Add manual model ID and embedding dimension configuration
- Enable custom model input via text field in settings UI
- Add modelDimension parameter to OpenAiCompatibleEmbedder
- Update configuration management to persist dimension setting
- Prioritize manual dimension over hardcoded model profiles
- Add comprehensive test coverage for new functionality
This allows users to specify any custom embedding model and its
dimension for OpenAI-compatible providers, removing dependency
on hardcoded model profiles.
* Add missing translations for OpenAI-compatible model dimension settings in all locales
* refactor: remove unused modelDimension parameter from OpenAiCompatibleEmbedder
- Remove modelDimension property and constructor parameter from OpenAiCompatibleEmbedder class
- Update ServiceFactory to not pass dimension to embedder constructor
- Update tests to match new constructor signature
- The dimension is still used for QdrantVectorStore configuration
* chore: bot suggestion
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* chore: bot suggestion
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* refactor: rename OpenAiCompatibleEmbedder to OpenAICompatibleEmbedder for consistency
* feat: add model dimension validation for OpenAI-compatible settings
* refactor: improve default model ID retrieval logic for embedding providers
* feat: add default model ID retrieval for openai-compatible provider
* refactor: update default model ID retrieval to use shared utility function
* fix: Remove unnecessary type assertion in OpenAICompatibleEmbedder
* feat: add model dimension input for openai-compatible provider
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* refactor: Unify history item UI with TaskItem and TaskItemHeader
Introduces `TaskItem.tsx` and `TaskItemHeader.tsx` to centralize and
standardize the rendering of history entries. `TaskItem` handles the
overall structure for "compact" (Preview) and "full" (HistoryView)
variants. `TaskItemHeader` consolidates all metadata (timestamp, tokens,
cost, cache, file size) into a single, consistent line above the task
content, enhancing visual clarity and reducing UI clutter.
This refactor significantly simplifies `HistoryPreview.tsx` and
`HistoryView.tsx`. Approximately 314 lines of previous rendering logic
were removed from these components and replaced by 242 lines in the new,
focused, and reusable `TaskItem` and `TaskItemHeader` components,
resulting in a net reduction and improved maintainability.
Most importantly, rendering logic happens in one place.
Key UI Changes:
- Metadata (timestamp, tokens, cost, cache, file size) now displayed
inline on a single header row in both variants.
- Removed explicit "Tokens:" and "API Cost:" labels for a cleaner look.
- Action buttons (Copy, Export, Delete) in the full view are now
aligned with the metadata header.
- File size is displayed in the header for the "full" variant only.
- Workspace information is no longer displayed in the "compact" preview.
Component Changes:
- Created `webview-ui/src/components/history/TaskItem.tsx` (125 lines)
- Created `webview-ui/src/components/history/TaskItemHeader.tsx` (117 lines)
- Modified `webview-ui/src/components/history/HistoryPreview.tsx` (-65 lines, +3 lines)
- Modified `webview-ui/src/components/history/HistoryView.tsx` (-249 lines, +3 lines)
- Uses `HistoryItem` type for standardized data handling.
Fixes: #4018
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
* test: fix TaskItem and HistoryView test failures after refactor
Fixes test failures that occurred after the major refactoring that introduced
the shared TaskItem component. The original implementation was correct but
the tests needed updates to match the new component structure.
- Add data-testid attributes to TaskItemHeader for reliable test selection
- Update TaskItem.test.tsx assertions to use new test IDs for tokens/cache
- Fix Checkbox import path in TaskItem.tsx (ui/checkbox vs ui)
- Add missing mocks for lucide-react and Checkbox in HistoryView.test.tsx
- Update HistoryView test assertions to use correct selectors
- Ensure all 19 history component tests pass successfully
The refactoring reduced code duplication by ~250+ lines while maintaining
functionality, and these test fixes ensure the quality gates remain intact.
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
* ui: move token and cost info from header to dedicated footer
Create a new TaskItemFooter component that displays token and cost information
with different styles for compact and full views. Move the CopyButton and
ExportButton from header to footer in full view. Adjust file size display
positioning in the header for better visual alignment.
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
* test: update history component tests to match implementation
Update data-testid attributes in HistoryView and TaskItem tests to match the
actual implementation in TaskItemFooter component. The tests were looking for
generic "tokens-in" and "tokens-out" attributes, but the implementation uses
variant-specific attributes like "tokens-in-footer-full".
Also added mocks for CopyButton and ExportButton components to resolve
"Element type is invalid" errors during test rendering.
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
* Move cache information from header to footer to be consistent with cost/token data
* Fix ESLint warnings: remove unused imports and variables
---------
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
* add support for mcp server instructions
* Update McpView.tsx
* feat(mcp): add instructions field to MCP localization files and update UI to display instructions
---------
Co-authored-by: huixin <yuanhx@cffex.com.cn>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
The Virtuoso component has a inner footer component that serves only as a bottom spacer, after investigation this component keeps re-rendering, beccause its unnecessary it was removed and the spaccing added to the component itselve
* feat: Add custom VPC endpoint support for AWS Bedrock
* fix: Fix TypeScript error in Bedrock.tsx
* fix: Update VPC endpoint UI to match Cline's implementation
* Fix AWS Bedrock VPC endpoint UI implementation
- Changed checkbox label to 'Use custom VPC endpoint' to match Cline
- Fixed conditional rendering to show text field when checkbox is checked
- Ensured placeholder text appears correctly
- Maintained proper styling for consistency
* Fix AWS Bedrock VPC endpoint UI implementation to match Cline exactly
- Added state variable to track checkbox selection
- Fixed conditional rendering to show/hide text field based on checkbox state
- Maintained proper styling and placeholder text
* Fix AWS Bedrock VPC endpoint UI implementation with proper event handling
- Fixed checkbox onChange handler to accept boolean directly instead of event object
- Added unit tests to verify the behavior
- Maintained proper styling and placeholder text
* Update Bedrock VPC endpoint tests with proper test IDs
* Improve AWS Bedrock VPC endpoint text field alignment
- Removed left margin from text field to align with checkbox
- Maintained proper styling and placeholder text
* Preserve AWS Bedrock VPC endpoint URL when toggling checkbox
- Added awsBedrockEndpointEnabled field to schema
- Modified Bedrock provider to check both endpoint URL and enabled flag
- Updated UI to preserve endpoint URL when checkbox is toggled
- Maintained proper alignment with checkbox
* Implement AWS Bedrock Custom VPC Endpoint functionality
* fix: update ApiConfiguration to ProviderSettings in Bedrock tests and regenerate types
* fix: update all instances of ApiConfiguration to ProviderSettings in Bedrock tests
* Fixed broken unit test
* Add changeset for Bedrock VPC endpoint support
* informative placeholder
* Bug fixes
* Fixed failing tests
* Add example URLs to Bedrock VPC endpoint section and update tests
* Fix truncated test assertion in Bedrock.test.tsx that was breaking the UI
* Refactor mock components in Bedrock.test.tsx for improved data-testid handling
* feat(i18n): add VPC endpoint translations for AWS Bedrock settings
* test: update Bedrock component tests for internationalized strings
---------
Co-authored-by: Kevin White <kcwhite@ancestry.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* feat(ConcurrentFileReadsExperiment): improve logic for enabling/disabling and add tests
* fix: ensure slider always displays valid value (min 2) for concurrent file reads
- Fix issue where slider could display values below minimum when enabled with maxConcurrentFileReads <= 1
- Add test cases for edge cases (value 0 and 1)
- Ensure UI always shows at least the minimum value of 2
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* feat(read_file): enhance file reading capabilities with multi-file support and improved parameter handling
fix(read_file): change return to continue on approval rejection in readFileTool
Enhance readFileTool with improved error handling and validation
- Introduced a FileEntry interface for better type management.
- Added validation for start_line and end_line to ensure proper ranges.
- Implemented RooIgnore validation before processing files.
- Enhanced error handling with dedicated functions for file and global errors.
- Streamlined file reading logic to handle binary files, definitions-only mode, and line thresholds more effectively.
- Improved user feedback for empty files and read limits.
chore: update Jest snapshot for system prompt tool usage
Refactor read-file tool to support XML input format and multiple line ranges
- Updated the `getReadFileDescription` function to reflect new XML structure for file reading requests.
- Modified `readFileTool` to parse XML input, allowing multiple line ranges for each file.
- Removed old parsing logic that handled line ranges as separate parameters.
- Implemented validation for line ranges and ensured proper error handling for file access.
- Adjusted approval messaging to accommodate new line range format.
- Enhanced error handling to provide consistent feedback for file read errors.
update from KJ7LNW comment
feat: add maxConcurrentFileReads setting to enhance read_file tool performance
feat: enhance readFileTool with XML parsing and file processing state tracking
feat: enhance readFileTool to include user feedback handling and processing state tracking
chore: clean up read_file tool documentation by removing extra newlines
feat: update read_file tool tests to handle user feedback and approval states
feat: add tests for feedback message formatting and XML special character handling in read_file tool
Implement code changes to enhance functionality and improve performance
feat: increase max concurrent file reads and adjust slider range in settings
feat: increase default max concurrent file reads from 5 to 15 across settings and context management
fix(read_file): enhance legacy path handling and remove duplicate parameters
feat(read_file): enhance file description handling and add support for multiple files in messages
done poc for new ux
idea 1
* fix the test
* fix: normalize locale file formatting to use tabs
- Applied prettier formatting to all locale JSON files
- Fixed mixed indentation (spaces/tabs) to use consistent tabs
- Aligns with project's prettier configuration
* fix(settings): improve checkbox handling and slider configuration in ConcurrentFileReadsExperiment
* fix(read_file): enhance description to include partial reads support
* fix(read_file): update description for partial reads and improve example clarity
* fix: suggestions
* fix: translations
* test: update system prompt snapshots for multi-file read tool
* fix: remove batch permission question from readFile tool translations
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* Add missing telemetry types
* Give IconButton the pointer cursor when enabled
* Change context condensing to use a Lucide icon
* Mock Lucide icons globally
- Remove AuthService callbacks, add user-info event
- Store userInfo on AuthService and fetch it when sessions go active
- Simplify CloudService callbacks to just stateChanged
- Add cloudUserInfo to state and remove authenticatedUser message
* [Condense] Skip condense and show error if the context grows
* update tests
* changeset
* nit: error should be nonempty
* update translations
* add more errors
* add more test cases
* update translations
* pipe error back from truncate code
* add condense_context_error ClineMessage
* fixes
* translations
* fix(webview): resolve memory leak in ChatView by stabilizing callback props
- Stabilize handleSendMessage using clineAskRef to prevent frequent re-creation
- Stabilize toggleRowExpansion by extracting handleSetExpandedRow and managing dependencies
- Re-integrate scrolling logic into useEffect hook to avoid destabilizing callbacks
- Add everVisibleMessagesTsRef to reduce unnecessary ChatRow remounts by Virtuoso
- Update onToggleExpand signature to accept timestamp parameter for better stability
- Remove diagnostic console.log statements used for debugging callback changes
These changes address detached DOM elements memory leak caused by frequent
callback re-creation triggering unnecessary component re-renders and preventing
proper garbage collection of chat message DOM nodes.
* comment correct TTL
---------
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
* feat: Enhance configuration change handling and model dimension checks
* fix: Update embedder creation to use modelId from config
* test: Add unit tests for ServiceFactory embedder and vector store creation
* test: Add comprehensive restart detection tests for configuration changes
* feat: Implement model ID selection logic for provider changes in CodeIndexSettings
* fix: Initialize configuration on constructor to prevent false restart triggers
* fix: Enhance API key handling and restart logic in CodeIndexConfigManager
* fix: Improve handling of external settings changes and automatic indexing in webviewMessageHandler
* fix: Ensure handleExternalSettingsChange only restarts service when manager is initialized
* refactor: remove console logs
* fix: Load configuration during initialization to ensure correct state and restart requirements