Commit graph

1430 commits

Author SHA1 Message Date
hannesrudolph
d5c92801ca Remove Glama provider integration and related references
- Deleted GlamaHandler export from providers index.
- Removed Glama callback handling from ClineProvider.
- Updated tests to exclude Glama API key and model checks.
- Removed Glama-related configurations from ProfileValidator and validation functions.
- Eliminated Glama components and settings from the UI.
- Cleaned up localization files by removing Glama-specific entries.
- Updated API utility functions to exclude Glama authentication.
2025-06-02 16:59:04 -06:00
Daniel
0ad6be7e6e
Unify history item UI with TaskItem and TaskItemHeader (#4151)
* 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>
2025-06-01 23:14:20 -04:00
Tony Zhang
662d6abfbd
fix: optimize ChatRowContent layout and styles (#4205)
* fix: optimize ChatRowContent layout and styles

* adjust ui calc performance
2025-06-01 23:09:29 -04:00
qingyuan1109
98711d45cf
add support for mcp server instructions (#3260)
* 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>
2025-06-01 22:28:27 -04:00
kiwina
03754f615d
Virtuoso footer re-rendering issue (#4209)
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
2025-06-01 16:52:17 -04:00
Matt Rubens
e40a4c96ed
Fix the label of the OpenAI-compatible API keys (#4191) 2025-05-31 22:18:23 -04:00
renovate[bot]
ff422b12f7
fix(deps): update dependency lucide-react to ^0.511.0 (#4182)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-31 16:04:43 -04:00
kcwhite
a4c91c65b3
Adding support for custom VPC endpoints when using AWS Bedrock models (#3947)
* 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>
2025-05-30 22:19:34 -04:00
Sam Hoang Van
0a06885305
feat(ConcurrentFileReadsExperiment): improve logic for enabling/disabling and add tests (#4154)
* 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>
2025-05-30 20:25:17 -04:00
Chris Estreich
9e3b0fd870
Move provider data into @roo-code/types (#4153) 2025-05-30 14:54:48 -07:00
Sam Hoang Van
9ba0cd5c7a
feat(read_file): enhance file reading capabilities with multi-file support and improved parameter handling (#2886)
* 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>
2025-05-30 17:09:42 -04:00
Matt Rubens
af5b1b402d
v3.19.0 (#4109) 2025-05-29 18:15:23 -04:00
Matt Rubens
8de608a0df
Account tab cleanup (#4119) 2025-05-29 16:41:19 -04:00
Chris Estreich
170fde848a
Add appName to TelemetryProperties (#4111) 2025-05-29 10:09:40 -07:00
Canyon Robins
3139971f4a
[Condense] Add condense button to expanded task view (#4110) 2025-05-29 09:37:49 -07:00
Matt Rubens
337b5dac88
Condensing fixes (#4107)
* Add missing telemetry types

* Give IconButton the pointer cursor when enabled

* Change context condensing to use a Lucide icon

* Mock Lucide icons globally
2025-05-29 10:45:13 -04:00
John Richmond
d4c00e58ed
Simplify CloudService callbacks (#4097)
- 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
2025-05-28 21:15:48 -07:00
Chris Estreich
7820b7517a
Roo Code Cloud (#4069)
Co-authored-by: John Richmond <5629+jr@users.noreply.github.com>
2025-05-28 20:43:30 -07:00
Canyon Robins
70e753ebb1
[Condense] Move condense button out of expanded task menu (#4093)
* [Condense] Move condense button out of expanded task menu

* tests

* fix test

* fix test again

* tailwind css
2025-05-28 18:58:08 -07:00
Canyon Robins
4804e3b3b9
[Condense] Move condense settings out of experimental and defualt enable (#4088)
* [Condense] Move condense settings out of experimental and defualt enable

* tests

* wip

* Update translations

* fixes

* more tests

* changeset

* wip

* update translations

* fix more translations
2025-05-28 17:05:39 -07:00
Matt Rubens
12669e1e64
Turn Prompts tab into Modes tab and move support prompts to Settings (#4078) 2025-05-28 17:47:37 -04:00
Canyon Robins
2e5a1a8e1d
[Condense] Skip condense and show error if the context grows (#4061)
* [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
2025-05-28 15:55:07 -04:00
xyOz
2c58caeb59
Chat input clearing during running task (#4084)
Fixes bug
2025-05-28 14:59:02 -04:00
Sacha Sayan
145ce6e7b5
Lock mermaid diagram sizes. (#3514) 2025-05-28 13:45:52 -04:00
ChuKhaLi
171307c2dc
fix: ensure correct precedence for roleDefinition and customInstructions when generating system prompt (#3791)
* fix: ensure correct precedence for roleDefinition and customInstructions

* Refactors mode selection logic for custom modes

Refactors the mode selection logic to prioritize custom modes
2025-05-28 13:23:49 -04:00
Sam Hoang Van
acd51c5120
fix(webview): resolve memory leak in ChatView by stabilizing callback props (#3926)
* 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>
2025-05-28 13:11:38 -04:00
Matt Rubens
1365800474
Fix centering of the about text (#4080) 2025-05-28 11:55:00 -04:00
Chris Estreich
e66136f1aa
Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
Matt Rubens
7509be8d41
Remove the hardcoded line breaks in the about (#3982) 2025-05-25 22:49:31 -04:00
Daniel
6a8fb599c1
Fix settings saving logic to ensure the saved settings are used (#3976)
* 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
2025-05-25 18:25:20 -04:00
Ruakij
503c7585de
Fix: Wrongfully clearing input on autoApprove (#3956) 2025-05-25 09:59:58 -04:00
Chris Estreich
77a5b6c06d
Fix reasoning budget for Gemini 2.5 Flash on OpenRouter (#3945)
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-05-24 19:46:42 -04:00
Daniel
68b60a2749
Add unsaved settings warning to codebase indexing settings view (#3944) 2025-05-24 18:51:15 -04:00
Daniel
20e7f118bc
Add handling for external settings changes (#3942) 2025-05-24 18:05:28 -04:00
Matt Rubens
b3962246d3
Fix codebase search results string (#3938) 2025-05-24 16:23:28 -04:00
Matt Rubens
2053d27d63
Default to full file reads (#3936) 2025-05-24 15:17:48 -04:00
Matt Rubens
6efa6746d6
Add a learn more link for indexing (#3935) 2025-05-24 15:02:37 -04:00
Matt Rubens
ca85162235
Handle partial messages in the codebase search tool (#3934) 2025-05-24 14:33:29 -04:00
Daniel
c357daf922
Fix Qdrant URL input default value (#3933) 2025-05-24 14:29:35 -04:00
Matt Rubens
4abadd877b
Default to Sonnet 4 (#3928) 2025-05-24 13:06:25 -04:00
Matt Rubens
b655c0d2e9
Make experimental settings more visually consistent (#3923) 2025-05-24 10:38:13 -04:00
Chris Estreich
1366ba0115
Preserve model settings when selecting a specific OpenRouter provider (#3915) 2025-05-23 23:22:41 -07:00
Daniel
61e122dc34
Codebase indexing (Clean history) (#3137)
* feat: apply changes from local main

* fix: add missing types

* feat: deduplicate code blocks coming out of parser

* feat: implement a cache manager to improve cache handling

* refactor: move code index service initialization to extension and remove await from indexing process

* fix: return undefined instead of throwing if no workspace is detected

* feat: allow auto approve if it is active for read tools

* refactor: improve UI of the results and allow opening the ranges directly in the editor

* refactor: use dependency injection to improve performance

* feat: implement result filtering by directory path

* refactor: centralize path normalization logic

* refactor: remove unnecessary barrel file

* refactor: prevent restarting the service if no settings change

* fix: the indexing process should never be awaited

* refactor: cleanup unused method

* refactor: remove batch limits for ollama

* refactor(parser): simplify method signatures and improve chunking logic

- Remove redundant min/max chars parameters
- Add better handling for oversized lines
- Improve chunking logic with segment handling
- Clean up method signatures and parameter ordering

* fix(settings): make select inputs full width in CodeIndexSettings

* refactor: increase max list file limit

* feat(ui): improve codebase search result display formatting

* test: add tests for cache and config managers

* test: create unit tests for parser and scanner

* feat(parser): improve segment hash uniqueness

- Added startCharIndex to segment hash calculation in _chunkTextByLines
- Track character position when splitting oversized lines
- Ensures unique identification of segments from same line

* feat(file-watcher): add error logging and optional ignoreController injection

* fix: allow getting the state if the service is disabled

* fix: set the embedding models when cline provider is initialized

* feat: use zod to validate form

* feat(file-watcher): enhance file watcher for batched deletions and improved vector store interactions

Improve file watcher to handle file deletions in batches and optimize vector store operations.

* feat(CodeIndexSettings): move OpenAI key input to a conditional rendering block

* feat(CodeIndexSettings): update button visibility based on indexing status

* feat(file-watcher): refactor vscode mock and enhance file watcher tests

* fix(CodeIndexManager): do not await startIndexing on configuration changes

* feat(types): add codeIndexOpenAiKey and codeIndexQdrantApiKey to ProviderSettings and IpcMessage

* feat(FileWatcher): enhance file processing with batch operations and new status handling

* fix(webviewMessageHandler): handle errors during CodeIndexManager initialization

* refactor(CodeIndexManager): streamline service creation by consolidating into a single method

* feat(CodeIndex): implement minimum search score configuration and update search methods

* refactor(CodeIndexSettings): replace ApiConfiguration with ProviderSettings and update related methods

* refactor: move contants to centralized file

* refactor(constants): rename CODEBASE_INDEX_SEARCH_MIN_SCORE to SEARCH_MIN_SCORE

* feat(QdrantVectorStore): enhance search functionality with new query structure and indexing

* feat(FileWatcher): implement batch processing and retry logic for upserting points

* fix(CodeIndexSettings): rename setProviderSettingsField to setApiConfigurationField and move model label

* fix(ChatRow): remove limit from search query messages

* refactor(CodebaseSearchResult): remove unused props from component

* feat: implement batch processing for file events in FileWatcher

- Introduced a new mechanism to accumulate file events (create, change, delete) and process them in batches.
- Added debounce functionality to optimize processing frequency.
- Emitted events for batch processing start, progress updates, and completion with detailed summaries.
- Refactored existing processing logic to handle batch deletions and upserts efficiently.
- Enhanced error handling and logging for better traceability during batch operations.

* feat(CodeIndex): implement batch processing and update progress reporting

* fix: define a default url for qdrant

* feat(CodeIndexManager): add initialization check and update startIndexing logic

* feat(CodeIndexSettings): validate Qdrant URL and update settings commitment logic

* feat: refactor progress calculation and update progress bar rendering

* refactor: remove webview provider and related methods

* fix: simplify indexing status update by directly using update values

* feat: integrate .gitignore support into file processing and scanning logic

* fix: update clearCacheFile method to write an empty object instead of deleting the cache file

* Revert this

* Run prettier

* fix: add new dependencies for qdrant client and directory scanner

* feat: add codebase search functionality to localization files

* feat: add localization strings for codebase indexing settings

* feat: integrate CodeIndexSettings into ExperimentalSettings and update settings localization

* refactor: remove console logs from various components for cleaner output

* feat: enhance capabilities section and codebase search tool description

* feat: add code indexing localization for multiple languages

* fix: correct indentation for CodeIndexSettings component in ExperimentalSettings

* refactor: update unit tests to properly test current functionality

* feat: add mock implementation for p-limit and update Jest config

* feat: track file creation, change, and deletion events in accumulatedEvents

* refactor: simplify file watcher tests by removing waitForFileProcessingToFinish and using direct event accumulation

* refactor: mock ContextProxy's getValue method to return current config name in ClineProvider tests

* refactor: mock missing properties required by codebase indexing manager

---------

Co-authored-by: cte <cestreich@gmail.com>
2025-05-23 19:07:19 -06:00
slytechnical
1791bb9053
Ability to refresh LiteLLM models list (take 2) (#3852)
* Litellm models can now be refreshed

* Fix no-case-declarations lint issue and put back missing autoCondenseContextPercent webviewMessageHandler case

* Add tests for litellm config changes

* replace hardcoded keys with constants
2025-05-23 16:19:40 -05:00
Chris Estreich
872902754a
Fix max tokens in the task header (#3893) 2025-05-23 02:32:21 -07:00
Chris Estreich
fa1e7b415c
Re-work support for reasoning models, including "hybrid" reasoning models (#3870) 2025-05-23 01:40:17 -07:00
Chris Estreich
6931cc9262
Fix global settings export (#3890) 2025-05-23 01:33:40 -07:00
SannidhyaSah
d149d65e14
Feature/condensing enhancements (#3826)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: Your Name <you@example.com>
2025-05-22 17:26:46 -04:00
Chris Estreich
39cd50b989
Fix linter errors (#3821) 2025-05-21 23:16:43 -07:00
Chris Estreich
c6851976fa
Fix vite server (#3816) 2025-05-21 21:39:41 -07:00