- Add hiddenDefaultModes field to global settings schema
- Update ExtensionStateContext to manage hidden modes state
- Modify getAllModes function to filter out hidden default modes
- Add UI controls in ModesView to toggle visibility of default modes
- Update ModeSelector to respect hidden modes setting
- Add backend message handler for hiddenDefaultModes
- Add comprehensive tests for the new functionality
- Add translation keys for new UI elements
Fixes#6638
feat: increase Claude Code default max output tokens from 8k to 16k
- Changed CLAUDE_CODE_DEFAULT_MAX_OUTPUT_TOKENS from 8000 to 16000
- Users can still lower it to 8k via environment variable if needed
- Addresses issue #6125 regarding output token limits
Co-authored-by: Roo Code <roomote@roocode.com>
* feat: add prompt caching support for LiteLLM (#5791)
- Add litellmUsePromptCache configuration option to provider settings
- Implement cache control headers in LiteLLM handler when enabled
- Add UI checkbox for enabling prompt caching (only shown for supported models)
- Track cache read/write tokens in usage data
- Add comprehensive test for prompt caching functionality
- Reuse existing translation keys for consistency across languages
This allows LiteLLM users to benefit from prompt caching with supported models
like Claude 3.7, reducing costs and improving response times.
* fix: improve LiteLLM prompt caching to work for multi-turn conversations
- Convert system message to structured format with cache_control
- Handle both string and array content types for user messages
- Apply cache_control to content items, not just message level
- Update tests to match new message structure
This ensures prompt caching works correctly for all messages in a conversation,
not just the initial system prompt and first user message.
* fix: resolve TypeScript linter error for cache_control property
Use type assertion to handle cache_control property that's not in OpenAI types
* feat: Adding more settings and control over Gemini
- with topP, topK, maxOutputTokens
- allow users to enable URL context and Grounding Research
* feat: Adding parameter titles and descriptions + translation to all languages
* feat: adding more translations
* feat: adding `contextLimit` implementation from `maxContextWindow` PR + working with profile-specific thresholding
* feat: max value for context limit to model's limit + converting description and titles to settings for translation purposes
* feat: all languages translated
* feat: changing profile-specific threshold in context management setting will also change in Gemini context management
- sync between Context Management Settting <-> Gemini Context Management with regards to thresholding
* feat: max value of maxOutputTokens is model's maxTokens + adding more tests
* feat: improve unit tests and adding `data-testid` to slider and checkbox components
* fix: small changes in geminiContextManagement descriptions + minor fix
* fix: Switching from "Gemini Context Management" to "Token Management
- better naming and correct purpose
* fix: input field showed NaN -> annoying UX
* fix: Removing redundant "tokens" after the "set context limit"'s checkbox + removing the lengthy description
* fix: Changing the translation to be consistent with the english one
* fix: more translations
* fix: translations
* fix: removing contextLimit and token management related code
- due to the decision in: https://github.com/RooCodeInc/Roo-Code/issues/3717
* fix: removing `contextLimit` test and removing token management in translations
* fix: changing from `Advanced Features` to `Tools` to be consistent with Gemini docs/AI studio
* fix: adding `try-catch` block for `generateContentStream`
* feat: Include citations + improved type safety
* feat: adding citation for streams (generateContextStream)
* fix: set default values for `topP`, `topK` and `maxOutputTokens`
* fix: changing UI/UX according to the review/feedback from `daniel-lxs`
* fix: updating the `Gemini.spec.tsx` unit test
- testing when it is hidden
- testing when users click on the collapsible trigger and model configuration appears
* fix: more changes from the feedback/review from `daniel-lxs`
* fix: adding sources at the end of the stream to preserve
* fix: change the description for grounding with google search and url context
* fix: adding translations
* fix: removing redundant extra translations - a mistake made by the agent
* fix: remove duplicate translation keys in geminiSections and geminiParameters
- Fixed duplicate keys in 13 localization files (es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi)
- Removed second occurrence of geminiSections and geminiParameters keys
- Kept first occurrence which contains more comprehensive descriptions
- All JSON files validated for syntax correctness
- Translation completeness verified with missing translations script
Resolves duplicate key issue identified in PR #4895
* fix: delete topK, topP and maxOutputTokens from Gemini
* fix: deleting topK, topP and maxOutputTokens from translations/locales
* fix: adjust spacing between labels and descriptions + sentence casing
* fix: adding maxOutputTokens back and removing unknown type
* fix: internalizing error Gemini error message
* fix: updating tests in Gemini and Vertex to adjust to the new error logging
* fix: address PR review feedback for Gemini tools feature
- Fix Hindi translation grammatical error in settings.json
- Internationalize 'Sources:' string and error messages in gemini.ts
- Add comprehensive error scenario tests to gemini-handler.spec.ts
- Remove unused currentModelId prop from Gemini component
- Update all locale files with new translation keys
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* feat: Add support for message queueing
* fix: address PR review feedback for message queueing feature
- Restore original ChatView tests from main branch
- Fix broken test by updating ChatTextArea mock
- Add comprehensive tests for message queueing (simplified due to mocking constraints)
- Fix race condition using useRef and setTimeout in queue processing
- Extract QueuedMessage interface to shared types.ts file
- Replace inline styles with Tailwind classes in QueuedMessages
- Add i18n support for 'Queued Messages:' text
- Add keyboard navigation for removing queued messages
- Add JSDoc for fromQueue parameter in handleSendMessage
* refactor: move QueuedMessage interface to packages/types
- Move QueuedMessage interface from local types.ts to packages/types/src/message.ts
- Update imports in ChatView.tsx and QueuedMessages.tsx to use @roo-code/types
- Remove local types.ts file to follow codebase conventions
* fix: add id field when creating queued messages
- Generate unique id using timestamp when adding messages to queue
- Fixes TypeScript error after moving QueuedMessage interface
* Stop disabling sending
* Translations
* Fix tests
* Improved styling
* Remove unused string
* Test cleanup
* fix: address message queueing issues
- Fix race condition in queue processing by re-checking queue state inside setTimeout
- Add error handling for queue operations with retry mechanism
- Replace array index with stable message.id for React keys in QueuedMessages
- Generate more unique IDs using timestamp + random component
* feat: add inline editing for queued messages
- Add ability to edit queued messages by clicking on them
- Support Enter to save and Escape to cancel edits
- Add textarea that auto-resizes based on content
- Add hover effect to indicate messages are editable
- Add translation for click to edit tooltip
* feat: add scrollbar and fix height for queued messages
- Add max-height of 300px with scrollbar to queue container
- Add flex-shrink-0 to prevent message items from being squished
- Ensure consistent height for message items when multiple messages are queued
* feat: add translations for queued message edit tooltip
- Add 'queuedMessages.clickToEdit' translation key to all 18 language files
- Provides localized tooltip text for the click-to-edit functionality
* fix: improve message queue processing reliability
- Fix race condition by removing nested setState and setTimeout
- Add retry limit (3 attempts) to prevent infinite loops
- Add proper cleanup on component unmount
- Clear queue when starting new task
- Prevent queue processing during API errors
- Fix ESLint warnings for React hooks dependencies
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* add more details
* format details better
* fix tests
* fix: address PR #6190 review feedback
- Move huggingface-models.ts to src/api/providers/fetchers/huggingface.ts
- Remove 'any' types and add proper TypeScript interfaces
- Add missing i18n keys and translations for all languages
- Replace magic numbers with named constants
- Add JSDoc documentation for HuggingFaceModel interface
- Improve error handling in API endpoint
- Update model capabilities display to match other providers
- Remove tool calling display (not used)
- Add comprehensive test coverage for new UI features
* fix: preserve HuggingFace provider details in model response
- Store raw HuggingFace models in cache to preserve provider information
- Export getCachedRawHuggingFaceModels to retrieve full model data
- Update huggingface-models.ts to return cached raw models when available
- Include provider name in model descriptions
- Always add provider-specific variants to show all available providers
- Remove console.log statements from fetcher
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
fix: add Hugging Face API key to SECRET_STATE_KEYS and fix validation
- Added huggingFaceApiKey to SECRET_STATE_KEYS array to ensure it's properly handled as a secret
- Fixed validateModelsAndKeysProvided to check for huggingFaceModelId when validating Hugging Face provider
- This fixes the issue where the welcome view wouldn't transition to chat view after configuring Hugging Face
* basic hugging face provider
* fetch hf models and providers
* save provider to config
* Update translations
---------
Co-authored-by: Thomas G. Lopes <26071571+TGlide@users.noreply.github.com>
InvalidClientTokenError indicates an unrecoverable state for
the session, so we need to be more exact about triggering it. A recent
Clerk outage resulted in a lot of 429 responses which should really cause
inactive-session, not a full clear to logged-out.
* feat: add configurable timeout for evals (5-10 min)
- Add timeout field to CreateRun schema with min 5, max 10, default 5
- Add timeout slider UI component to /runs/new page
- Update database schema to include timeout column in runs table
- Create migration to add timeout column with default value of 5
- Update runTask.ts to use configurable timeout from run settings
- Pass timeout parameter through the createRun action
* fix: remove unused EVALS_TIMEOUT import
* fix: add timeout field to createRun calls in copyRun test
- Added timeout: 5 to both createRun calls in copyRun.spec.ts
- This fixes the test failure caused by the new required timeout field in the runs schema
- The timeout field was added in the configurable timeout feature but the test was not updated
* fix: use configurable timeout for Redis key expiration in registerRunner
- Updated registerRunner function to accept timeoutSeconds parameter
- Modified call in runTask.ts to pass configurable timeout instead of hardcoded EVALS_TIMEOUT
- Removed unused EVALS_TIMEOUT import from redis.ts
- Ensures Redis keys remain valid for the entire duration of task execution (up to 10 minutes)
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: hannesrudolph <hrudolph@gmail.com>
* fix: add character limit to prevent terminal output context explosion
- Enhanced truncateOutput function to accept character limits alongside line limits
- Character limits take priority over line limits to prevent context window explosion
- Added terminalOutputCharacterLimit setting (default: 100,000 characters)
- Updated all terminal output processing to use both limits
- Added comprehensive tests for character limit functionality
Fixes#5775
* feat: add terminal output character limit setting to UI
- Add character limit slider to Terminal Settings UI (default: 50,000)
- Update ExtensionStateContext to manage character limit state
- Add validation for positive character limit values
- Add English translation and translations for all 17 supported languages
- Connect UI to backend through proper message handling
- Character limit takes precedence over line limit to prevent memory issues
* fix: update test expectations for character limit edge cases
- Fix multi-byte character test to account for JavaScript's string length behavior
- Fix newline content test to match actual slice behavior
- Tests now correctly validate the truncateOutput function's character limit handling
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* 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
* feat: add configurable delay for Go diagnostics to prevent premature error reporting
- Add diagnosticsDelayMs setting (default: 2000ms) to allow linters time to process
- Add diagnosticsEnabled setting to optionally disable diagnostic checking entirely
- Update DiffViewProvider.saveChanges() to use configurable delay before checking diagnostics
- Update all tool files (writeToFile, searchAndReplace, insertContent, applyDiff, multiApplyDiff) to pass diagnostic settings
- Add comprehensive tests for new diagnostic functionality
- Fixes issue where Go diagnostics errors were submitted to LLM before linter could clean up unused imports
Resolves#5859
* fix: add missing TypeScript type definitions for diagnostic settings
- Add diagnosticsDelayMs and diagnosticsEnabled to globalSettingsSchema
- Include properties in ExtensionState Pick type
- Add default values to EVALS_SETTINGS
- Fix VSCode mock to include DiagnosticSeverity for tests
- Resolves compilation errors in ClineProvider and webviewMessageHandler
* fix: update test mocks to support diagnostic settings in tool tests
- Add providerRef mock to insertContentTool and writeToFileTool tests
- Update mocks to include diagnosticsEnabled and diagnosticsDelayMs settings
- Fix test expectations to match new implementation with diagnostic configuration
- Resolves failing unit tests for insertContentTool.spec.ts and writeToFileTool.spec.ts
* fix: remove package-lock.json file (project uses pnpm)
* refactor: use existing writeDelayMs instead of diagnosticsDelayMs
- Remove diagnosticsDelayMs setting in favor of existing writeDelayMs
- Add min(0) validation for writeDelayMs in global settings schema
- Add error handling around delay function calls in DiffViewProvider
- Create DEFAULT_WRITE_DELAY_MS constant (1000ms) to replace repeated defaults
- Update all tool files to pass writeDelayMs instead of diagnosticsDelayMs
- Remove diagnosticsDelayMs from webview message handlers and types
- Update test files to use writeDelayMs instead of diagnosticsDelayMs
This refactoring consolidates diagnostic delay functionality to use the
existing writeDelayMs setting as requested in PR feedback.
* fix: resolve failing unit tests and TypeScript compilation errors
- Fix DiffViewProvider test to expect correct default delay (1000ms instead of 2000ms)
- Fix TypeScript type errors in ClineProvider test mock state object
- Correct terminalPowershellCounter and terminalZdotdir types to boolean
- Fix pinnedApiConfigs type from array to Record<string, boolean>
* fix: remove unrelated changes from ClineProvider.spec.ts
- Removed extensive unrelated property additions to mock state
- Kept only diagnosticsEnabled property which is related to Go diagnostics delay feature
- Removed unused DEFAULT_WRITE_DELAY_MS import
- Restored original structure and organization of mock state object
This addresses the feedback to remove unrelated changes while preserving
the necessary diagnostic functionality for the Go diagnostics delay feature.
* refactor: move DEFAULT_WRITE_DELAY_MS to packages/types/src/global-settings.ts
- Move DEFAULT_WRITE_DELAY_MS constant from src/shared/constants.ts to packages/types/src/global-settings.ts
- Update all import statements in affected files to use @roo-code/types
- Delete src/shared/constants.ts file as it is no longer needed
- Files updated:
- src/integrations/editor/DiffViewProvider.ts
- src/core/webview/ClineProvider.ts
- src/core/tools/multiApplyDiffTool.ts
- src/core/tools/applyDiffTool.ts
- src/core/tools/searchAndReplaceTool.ts
- src/core/tools/insertContentTool.ts
- src/core/tools/writeToFileTool.ts
---------
Co-authored-by: Roo Code <roomote@roocode.com>
* fix: detect Claude models by name for API protocol selection
- Modified getApiProtocol to accept modelId parameter
- Added check for 'claude' in model name (case-insensitive)
- Updated Task.ts to pass model ID to getApiProtocol
- Added comprehensive tests for the new logic
Fixes#5830
* fix: limit Claude model detection to vertex and bedrock providers only
- Modified getApiProtocol to only detect Claude models by name when provider is vertex or bedrock
- Added comprehensive unit tests for getApiProtocol function as requested in PR review
- This ensures Claude models are only auto-detected for providers that need it