Commit graph

73 commits

Author SHA1 Message Date
Daniel
b9cf163b87
fix: use relative paths in isPathInIgnoredDirectory to fix worktree indexing (#11009) 2026-01-27 12:43:47 -05:00
Chris Estreich
a4eb15b5a8
Add some functionality to @roo-code/core for the cli (#10584) 2026-01-09 13:05:15 -08:00
roomote[bot]
f899de1f53
fix: add userAgentAppId to Bedrock embedder for code indexing (#10166)
Adds userAgentAppId configuration to the BedrockRuntimeClient in the
code indexing embedder, matching the implementation pattern already
used in the main Bedrock API provider.

This enables proper user agent identification in CloudTrail AWS requests
when using Bedrock for code indexing embeddings.

Fixes #10165

Co-authored-by: Roo Code <roomote@roocode.com>
2025-12-17 20:20:36 -05:00
SannidhyaSah
873a763ea7
feat: Add provider routing selection for OpenRouter embeddings (#9144) (#9693)
Co-authored-by: Sannidhya <sann@Sannidhyas-MacBook-Pro.local>
2025-12-02 22:59:55 -05:00
roomote[bot]
16f36896e2
fix: update default settings for inline terminal and codebase indexing (#9622)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-11-26 17:10:27 -05:00
George Goranov
56c630ca92
Feature/bedrock embeddings support (#9475)
* feat: add AWS Bedrock support for codebase indexing

- Add bedrock as a new EmbedderProvider type
- Add AWS Bedrock embedding model profiles (titan-embed-text models)
- Create BedrockEmbedder class with support for Titan and Cohere models
- Add Bedrock configuration support to config manager and interfaces
- Update service factory to create BedrockEmbedder instances
- Add comprehensive tests for BedrockEmbedder
- Add localization strings for Bedrock support

Closes #8658

* fix: add missing bedrockOptions to loadConfiguration return type

* Fix various issues that the original PR missed.

* Remove debug logs

* Rename AWS Bedrock -> Amazon Bedrock

* Remove some 'as any's

* Revert README changes

* Add translations

* More translations

* Remove leftover code from a debugging session.

* fix: add bedrock to codebaseIndexModelsSchema and update brace-expansion override

- Add bedrock provider to codebaseIndexModelsSchema type definition to fix empty model dropdown in UI
- Update pnpm override for brace-expansion from '>=2.0.2' to '^2.0.2' to resolve ESM/CommonJS compatibility issues

* Improvements to AWS Bedrock embeddings support

- Enhanced bedrock.ts embedder implementation
- Added comprehensive test coverage in bedrock.spec.ts
- Updated config-manager.ts for better Bedrock configuration handling
- Improved service-factory.ts integration
- Updated embeddingModels.ts with Bedrock models
- Enhanced CodeIndexPopover.tsx UI for Bedrock options
- Added auto-populate test for CodeIndexPopover
- Updated pnpm-lock.yaml dependencies

* Restore openrouter config

* Remove debug log

* Fix config-manager.spec.ts unit test.

* Add translations for "optional"

* Revert unnecessary change related to open ia embedder

---------

Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: Smartsheet-JB-Brown <jb.brown@smartsheet.com>
2025-11-26 08:58:58 -05:00
Matt Rubens
3c989d3591
Revert "Add support for Roo Code Cloud as an embeddings provider" (#9602) 2025-11-26 00:08:39 -05:00
Matt Rubens
fb4f23537a
Add support for Roo Code Cloud as an embeddings provider (#9543) 2025-11-24 17:21:30 -05:00
roomote[bot]
413ab1a95c
feat: add Qwen3 embedding models (0.6B and 4B) to OpenRouter support (#9060)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-11-05 15:35:25 -05:00
Daniel
f717863a32
fix: correct OpenRouter Mistral model dimension from 3072 to 1536 (#9028) 2025-11-04 12:29:04 -05:00
David Markey
34f45f1b28
feat: add OpenRouter embedding provider support (#8973)
* feat: add OpenRouter embedding provider support

Implement comprehensive OpenRouter embedding provider support for codebase indexing with the following features:

- New OpenRouterEmbedder class with full API compatibility
- Support for OpenRouter's OpenAI-compatible embedding endpoint
- Rate limiting and retry logic with exponential backoff
- Base64 embedding handling to bypass OpenAI package limitations
- Global rate limit state management across embedder instances
- Configuration updates for API key storage and provider selection
- UI integration for OpenRouter provider settings
- Comprehensive test suite with mocking
- Model dimension support for OpenRouter's embedding models

This adds OpenRouter as the 7th supported embedding provider alongside OpenAI, Ollama, OpenAI-compatible, Gemini, Mistral, and Vercel AI Gateway.

* Add translation key

* Fix mutex double release bug

* Add translations

* Add more translations

* Fix failing tests

* code-index(openrouter): fix HTTP-Referer header to RooCodeInc/Roo-Code; i18n: add and wire OpenRouter Code Index strings; test: assert default headers in embedder

---------

Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2025-11-02 19:12:28 -05:00
roomote[bot]
89d67efc6d
fix: add keyword index for type field to fix Qdrant codebase_search error (#8964)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-11-01 13:20:56 -04:00
Seth Miller
f9d6fe7985
Fix: Enhanced codebase index recovery and reuse ('Start Indexing' button now reuses existing Qdrant index) (#8588)
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2025-10-30 15:59:51 -04:00
Daniel
759454b455
fix: handle ByteString conversion errors in OpenAI embedders (#8008) 2025-09-15 22:56:20 -04:00
NaccOll
1e403a7c92
fix: identify mcp and slash command config path in multiple folder workspace (#6904) 2025-09-05 14:52:48 -04:00
roomote[bot]
fe2b6126c6
feat: add configurable embedding batch size for code indexing (#7464)
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-09-01 21:36:56 -04:00
Chris Estreich
cd9e92fa9b
Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
Matt Rubens
1ad2129964
Add support for Vercel embeddings (#7445)
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2025-08-27 13:30:19 -04:00
Daniel
11c454ffa2
feat: Enable on-disk storage for Qdrant vectors and HNSW index (#7182) 2025-08-26 17:02:55 -04:00
roomote[bot]
bbe3362359
fix: ensure JSON files respect .rooignore during indexing (#6691)
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-08-12 12:52:08 -04:00
roomote[bot]
2b647ed9a1
fix: handle current directory path "." correctly in codebase_search tool (#6517)
* fix: handle current directory path "." correctly in codebase_search tool

- Fix path filtering logic in QdrantVectorStore.search() to properly handle current directory representations
- When directoryPrefix is ".", "./", "", or similar, set filter to undefined to search entire workspace
- Add comprehensive tests covering various current directory path formats including cross-platform support
- Resolves issue where codebase_search with path="." returned no results

Fixes #6514

* fix: normalize directory prefix handling in Qdrant vector store

* fix: normalize paths starting with './' and fix OS-dependency issue

- Use forward slash for splitting after toPosix() conversion
- Remove leading './' from paths like './src' to normalize them to 'src'
- Update test expectations to match correct behavior

* refactor: use path.posix.normalize instead of custom toPosix method

- Replaced directoryPrefix.toPosix() with path.posix.normalize()
- Added proper handling of backslashes before normalization
- Updated test mock to include posix.normalize method
- All tests passing (381 tests in code-index service)

* refactor: address review comments - improve path normalization

- Keep check for './' after normalization as path.posix.normalize('./') returns './'
- Use actual Node.js path.posix implementation in tests instead of custom mock
- Apply path.posix.normalize to cleanedPrefix for consistency

All 381 code-index tests pass

* fix: apply path.posix.normalize when cleaning prefix to avoid redundant normalization

Addresses review comment from @mrubens to normalize the path at line 385 instead of normalizing twice

* fix: correct current directory detection logic

The issue was that the condition checked for an empty string after normalization,
but path.posix.normalize('') actually returns '.', not ''. This caused the
current directory check to fail when an empty string was passed.

Removed the redundant empty string check since normalize('') returns '.' which
is already handled by the first condition.

---------

Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: hannesrudolph <hrudolph@gmail.com>
2025-08-06 06:28:28 -07:00
roomote[bot]
34fb5b7c37
fix: recover from error state when Qdrant becomes available (#6661)
* fix: recover from error state when Qdrant becomes available

- Add recoverFromError method to CodeIndexManager to clear error state and reset internal services
- Update startIndexing handler to check for error state and recover before initialization
- Add comprehensive tests for error recovery functionality

Fixes #6660

* fix: address PR review comments for code indexing error recovery

- Add race condition protection for multiple rapid clicks on Start Indexing button
- Add error handling for setSystemState in recoverFromError method
- Enhance JSDoc documentation for recoverFromError method
- Add test cases for recoverFromError idempotency and error handling

* refactor: move error recovery logic into startIndexing method

- Moved error recovery from webviewMessageHandler into CodeIndexManager.startIndexing()
- This ensures error recovery happens whenever indexing is started, not just from UI
- Added race condition prevention flag within CodeIndexManager
- Simplified webviewMessageHandler by removing error state checking
- The startIndexing method now automatically recovers from error state before proceeding

* fix: remove await from startIndexing calls and update JSDoc

- startIndexing should never be awaited as it's a long-running background process
- Added JSDoc warning to never await this method
- Updated webviewMessageHandler to not await startIndexing calls

* fix: use platform-agnostic paths in code-index manager tests for Windows compatibility

---------

Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-08-06 06:26:34 -07:00
Nitesh
4f4328d97c
Add swift files to fallback list (#6724) 2025-08-05 14:19:23 -07:00
NaccOll
d90bab71ff
feat: code indexing support multiple folder similar with task history (#6204)
* feat: Implement code indexing support multi-folder workspaces similar to task history

* fix: add missing mock for onDidChangeActiveTextEditor in tests
2025-08-04 19:39:37 -07:00
Daniel
7cbb37df74
fix: Fix VB.NET indexing by implementing fallback chunking system (#6552) 2025-08-01 14:55:45 -04:00
Daniel
5041880da0
fix: handle Qdrant deletion errors gracefully to prevent indexing interruption (#6296) 2025-07-31 16:20:11 -04:00
Adam Brand
7a07088802
Add pattern to support Databricks /invocations endpoints (#6317)
For using other models in Azure (e.g., Claude); you have to use Databricks, and the other patterns didn't match that.
2025-07-30 18:31:26 -04:00
Daniel
440ec30d66
fix: add error message when no workspace folder is open for code indexing (#6227)
* fix: add error message when no workspace folder is open for code indexing

- Add 'Indexing requires an open workspace folder' error message in orchestrator.ts
- Replace hardcoded error string with translatable message using i18n
- Add translations for the error message in all 18 supported languages
- Ensures proper error handling when users attempt code indexing without a workspace

* fix: add workspace folder checks for code indexing operations

- Add null checks for codeIndexManager in webviewMessageHandler
- Show translated error message when no workspace folder is open
- Prevents crashes when users try to use indexing features without a workspace
- Uses existing translation key from orchestrator

* Update src/i18n/locales/ca/embeddings.json

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-07-25 20:14:35 -04:00
Nahim EL ATMANI
b1406342a8
Fix Ollama API URL normalization by removing trailing slashes (#6079)
Co-authored-by: Nahim El Atmani <2959826+Naam@users.noreply.github.com>
2025-07-25 00:41:35 -04:00
SannidhyaSah
7ddc4e64f3
feat: Add Mistral embedding provider (#5932) (#5946)
* feat: add Mistral embedding provider with OpenAI Compatible Wrapper

- Implement MistralEmbedder class using OpenAI-compatible API
- Add comprehensive unit tests with 100% coverage
- Update type definitions for Mistral provider support
- Integrate Mistral option in UI components and configuration
- Add internationalization support for Mistral provider
- Fix API key storage and retrieval for embedding providers
- Update service factory to support Mistral embeddings
- Add proper error handling and validation

This implementation allows users to use Mistral's embedding models
through the existing OpenAI-compatible wrapper approach, providing
a seamless integration experience.

* feat: add Mistral embedding provider support

- Implement MistralEmbedder class with API integration
- Add Mistral models to embedding model configurations
- Update UI to include Mistral provider option
- Add comprehensive unit tests for Mistral embedder
- Update type definitions and interfaces
- Add internationalization support for Mistral provider

* fix: add missing translations for Mistral embedding provider

* fix: address PR review feedback - improve translations and add clarifying comment
2025-07-19 13:24:24 -04:00
Daniel
cc369da2d5
feat: add batch limiting to code indexer (#5891)
feat: add batch limiting to code indexer to control memory usage

- Add MAX_PENDING_BATCHES constant (20) to limit concurrent batches
- Implement backpressure mechanism to pause file parsing when limit reached
- Prevent memory overflow during large codebase indexing
2025-07-19 09:37:37 -04:00
Daniel
020c2337dd
feat: add global rate limiting for OpenAI-compatible embeddings (#5854)
* feat: add global rate limiting for OpenAI-compatible embeddings

- Implement shared rate limit state across all embedder instances
- Add exponential backoff (5s base, up to 5 minutes max)
- Track consecutive rate limit errors with auto-reset after 60s
- Add thread-safe mutex for concurrent access
- Remove verbose logging to prevent log flooding during retries
- Add comprehensive test coverage for rate limiting behavior

This prevents multiple parallel batches from overwhelming APIs with
restrictive rate limits by coordinating delays globally.

* fix: restore original logging while keeping rate limit logging silent

- Restored all original console.warn and console.error calls that were inadvertently removed
- Only the rate limit retry warning remains silent (no console output)
- Fixed test expectation to use correct error variable
- All existing logging behavior is preserved
2025-07-19 09:37:01 -04:00
Daniel
a7a6bcb30f
fix: resolve DirectoryScanner memory leak and improve file limit handling (#5785) 2025-07-16 15:06:26 -04:00
Daniel
8c8888a977
feat: increase Ollama API timeout values and extract as constants (#5778)
- Increase embedding request timeout from 10s to 60s
- Increase validation request timeouts from 5s to 30s
- Extract timeout values as module-level constants for better maintainability
- OLLAMA_EMBEDDING_TIMEOUT_MS = 60000 (60 seconds)
- OLLAMA_VALIDATION_TIMEOUT_MS = 30000 (30 seconds)
2025-07-16 09:30:33 -04:00
Daniel
5cab585eb3
fix: prioritize built-in model dimensions over custom dimensions (#5705) 2025-07-14 16:20:34 -04:00
Daniel
d7787a2de3
feat: add gemini-embedding-001 model to code-index service (#5698)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-07-14 14:10:40 -04:00
Roomote Bot
f71275ef55
fix: resolve vector dimension mismatch error when switching embedding models (#5616) (#5617)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-07-14 14:10:09 -04:00
Daniel
5bffebde58
feat: add enable/disable toggle for code indexing (#5599) 2025-07-12 12:55:50 -04:00
Daniel
32308d79c4
feat: add comprehensive error telemetry to code-index service (#5595) 2025-07-11 23:01:50 -04:00
Daniel
50598b22b5
fix(i18n): Correct translation fallback logic for embedding errors (#5574)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-07-10 15:47:47 -04:00
Daniel
97b917eac8
fix: handle Qdrant vector dimension mismatch when switching embedding models (#5562) (#5565) 2025-07-10 11:29:25 -04:00
Daniel
45f3d88ddf
fix(embeddings): Translate error messages before sending to UI (#5535)
fix(embeddings): translate error messages before sending to UI

- Import t() function from i18n module
- Wrap error messages with t() translation function in _initializeEmbedder()
- Ensures proper localization of error messages in the UI
- Falls back to original message if no translation exists
2025-07-09 19:22:05 -04:00
Murilo Pires
fa60a31578
Indexing field validation (#5483)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-07-08 23:15:37 -04:00
Daniel
09e348e21c
Move codebase indexing out of experimental (#5481) 2025-07-08 23:07:36 -04:00
Daniel
c551e17327
refactor: remove legacy codebaseIndexOpenAiCompatibleModelDimension property (#5459) 2025-07-08 14:43:03 -04:00
Hannes Rudolph
d4abe73875
fix: add embedder validation to prevent misleading status indicators (#4398) (#5404)
* fix: add embedder validation to prevent misleading status indicators (#4398)

* fix: address PR feedback and fix critical issues

- Fixed settings-save flow to save before validation
- Fixed Error constructor usage in scanner.ts
- Fixed segment identification in file-watcher.ts
- Added missing translation keys for embedder validation errors

* fix: add missing Ollama translation keys

- Added missing ollama.title, description, and settings keys
- Fixed translation check failure in CI/CD pipeline
- Synchronized all 17 non-English locale files

* feat: add proactive embedder validation on provider switch

- Validate embedder connection when switching providers
- Prevent misleading 'Indexed' status when embedder is unavailable
- Show immediate error feedback for invalid configurations
- Add comprehensive test coverage for validation flow

This ensures users get immediate feedback when configuring embedders,
preventing confusion when providers like Ollama are not accessible.

* fix: improve error handling and validation in code indexing process

* refactor: extract common embedder validation and error handling logic

- Created shared/validation-helpers.ts with centralized error handling utilities
- Refactored OpenAI, OpenAI-Compatible, and Ollama embedders to use shared helpers
- Eliminated duplicate error handling code across embedders
- Improved maintainability and consistency of error handling
- Fixed test compatibility in manager.spec.ts
- All 2721 tests passing

* refactor: simplify validation helpers by removing unnecessary wrapper functions

- Removed getErrorMessageForConnectionError and inlined logic into handleValidationError
- Removed isRateLimitError, logRateLimitRetry, and logEmbeddingError wrapper functions
- Updated openai.ts and openai-compatible.ts to inline rate limit checking and logging
- Reduced code complexity while maintaining all functionality
- All 311 tests continue to pass

* fix: add missing invalidResponse i18n key and fix French translation

- Added missing 'invalidResponse' key to all locale files
- Fixed French translation: changed 'and accessible' to 'et accessible'
- Ensures proper error messages are displayed when embedder returns invalid responses

* fix: restore removed score settings in webviewMessageHandler

- Restored codebaseIndexSearchMaxResults and codebaseIndexSearchMinScore settings that were unintentionally removed
- Keep embedder validation related changes

* fix: revert unintended changes to file-watcher and scanner

- Reverted point ID generation back to using line numbers instead of segmentHash
- Restored { cause: deleteError } parameter in scanner error handling
- These changes were unrelated to the embedder validation feature

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-07 18:46:35 -04:00
Murilo Pires
6ec017ca65
fix: correct export/import of OpenAI Compatible codebase indexing set… (#5383) 2025-07-07 11:53:33 -04:00
Hannes Rudolph
7d31966978
fix: resolve workspace path inconsistency in code indexing for multi-workspace scenarios (#4397) (#5403)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-07 11:29:57 -04:00
Murilo Pires
4a78f51fe5
Feat/issue 5149 configurable max search results (#5402)
* feat: add configurable max search results for codebase indexing (#5149)

- Add codebaseIndexSearchMaxResults to configuration schema with validation (10-1000)
- Update Qdrant client to accept maxResults parameter in search method
- Add UI slider in Experimental Settings to configure max search results
- Rename constants to DEFAULT_MAX_SEARCH_RESULTS and DEFAULT_SEARCH_MIN_SCORE for clarity
- Add translations for new setting across all 17 supported languages
- Add comprehensive test coverage for config manager, Qdrant client, and UI components

fix: settings persistence for codebase index configuration

- Add new updateCodebaseIndexConfig message type to properly merge config updates
- Update SettingsView to send entire codebaseIndexConfig object instead of just enabled flag
- Add backend handler to merge configuration updates instead of overwriting
- Add tests for the new message handler functionality

This ensures the max search results setting persists correctly when saved.

* fix: correct property name in updateCodebaseIndexConfig message

The frontend was sending 'config' but the backend expects 'codebaseIndexConfig'.
This mismatch was preventing the max search results setting from persisting.

* feat: refactor codebase index constants and update search result defaults

* feat(chat): add advanced settings for maximum search results configuration

* refactor: remove updateCodebaseIndexConfig and integrate max search results into saveCodeIndexSettingsAtomic

- Removed updateCodebaseIndexConfig message type and handler as per PR feedback
- Added codebaseIndexSearchMaxResults to codeIndexSettings type in WebviewMessage.ts
- Updated saveCodeIndexSettingsAtomic to save codebaseIndexSearchMaxResults
- Fixed SettingsView.tsx to use codebaseIndexEnabled message instead of updateCodebaseIndexConfig

* Delete webview-ui/src/components/settings/__tests__/ExperimentalSettings.spec.tsx

* refactor: remove updateCodebaseIndexConfig tests to streamline codebase indexing logic

* revert this

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-07-04 20:55:15 -04:00
Murilo Pires
f478a5c72c
fix: resolve Go duplicate references in tree-sitter queries (#5367) (#5377)
* fix: resolve Go duplicate references in tree-sitter queries (#5367)

- Replace broad statement captures with function-scoped queries
- Eliminates overlapping captures that caused duplicate references
- Improves search quality and indexing performance for Go projects
- Add test to validate no duplicate line ranges are captured
- Maintains backward compatibility with existing functionality

Fixes #5367

* fix: resolve Go codebase indexing with language-specific thresholds

- Update Go tree-sitter queries to capture full declarations instead of just identifiers
- Implement language-specific character thresholds (50 chars for Go vs 100 default)
- Fix inspectGo.spec.ts test to match new query behavior
- Add comprehensive test coverage for Go indexing fix

This ensures Go files are properly indexed for semantic search while preventing
duplicate references. All tests now pass.

* fix: implement universal 50-character threshold for code indexing

- Changed MIN_BLOCK_CHARS from 100 to 50 in parser.ts
- Updated tests to expect single-block captures for small Go files
- Removed language-specific threshold logic
- Fixes Go files not being indexed due to high character threshold

Fixes #5367

* test: replace Go-specific test with generic MIN_BLOCK_CHARS test

- Remove go-indexing-fix.spec.ts as requested in PR feedback
- Add generic test in parser.spec.ts to verify 50-character threshold
- Test ensures content under 50 chars is filtered, 50+ chars is indexed
- Applies to all languages, not just Go

* fix: update markdown tests for MIN_BLOCK_CHARS change from 100 to 50
2025-07-04 20:49:40 -04:00