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.
* fix: sort symlinked rules files alphabetically
- Add alphabetical sorting to readTextFilesFromDirectory function
- Sort by basename of filename (case-insensitive) for consistent order
- Fixes issue where symlinked rules were read in random order
- Add test case to verify alphabetical sorting behavior
Fixes#4131
* chore: remove solution-indicating comment per PR feedback
* fix: sort symlinks by their symlink names, not target names
- Modified readTextFilesFromDirectory to store both original symlink path and resolved target path
- Updated resolveDirectoryEntry and resolveSymLink to track both paths
- Sort files by original path (symlink name) but read content from resolved path
- Added test to verify symlinks are sorted by their names, not their target names
- This ensures consistent alphabetical ordering when using symlinks in rules directories
---------
Co-authored-by: Roo Code <roomote@roocode.com>
When running vitest without the run parameter, it enters watch mode and waits for user input (like pressing q to quit), causing tests to hang in the terminal.
This change updates the documentation to specify using npx vitest run instead of just npx vitest to ensure tests run to completion without requiring user interaction.
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
* feat: auto-omit MCP content when no servers are configured
- Modify system prompt generation to detect when no MCP servers are defined
- Only include MCP sections when mode has mcp group AND servers exist
- Pass undefined mcpHub to capabilities and tools when no servers available
- Reduces system prompt verbosity when MCP functionality is not in use
* fix: add missing Uri and RelativePattern exports to VSCode mocks
- Added Uri and RelativePattern exports to global VSCode mock in __mocks__/vscode.js
- Fixed McpHub.spec.ts VSCode mock to include Uri and RelativePattern
- Fixed Task.spec.ts VSCode mock to include Uri and RelativePattern with proper TypeScript typing
- Resolves unhandled rejection errors in unit tests caused by missing VSCode API mocks
* fix: add proper TypeScript typing for RelativePattern in McpHub test mock
* fix: resolve unit test failures in PR #5889
- Fix VSCode mock onDidChangeWorkspaceFolders to accept callback parameter
- Update MCP test mocks to properly test auto-omit functionality
- Update test snapshots to reflect new MCP content omission behavior
- All core functionality tests now passing
* chore: remove package-lock.json as project uses npm
* fix: remove unrelated mock changes from PR
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* 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>
* feat: add Issue Fixer Orchestrator mode
* fix: allow export task history while API is active (#5324)
- Add exportAlwaysEnabled prop to TaskActions component
- Export button remains enabled when exportAlwaysEnabled is true
- Other action buttons still respect buttonsDisabled state
- Add tests to verify the new behavior
This fixes the regression where users couldn't export task history
during API operations, which is a common debugging workflow.
* fix: simplify export button to always be enabled
The export functionality is not impacted by the model streaming state,
so the button should always be enabled. Removed the unnecessary
exportAlwaysEnabled prop and simplified the implementation.
- Remove exportAlwaysEnabled prop from TaskActions
- Remove disabled attribute from export button entirely
- Update TaskHeader to remove exportAlwaysEnabled prop usage
- Update tests to reflect that export is always enabled
* fix: enable export, share, and copy buttons during API operations
- Export, share, and copy buttons now remain enabled when API is active
- Delete button still respects buttonsDisabled state for safety
- Removed unnecessary exportAlwaysEnabled prop
- Updated tests to reflect new behavior
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@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 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
* 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
* 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
* improved chat row first pass
* big UI improvements
* working functionality
* tests working
* ok finally tests working for real!
* translations
* add back hidden flag
* remove option to skip notif
* fixed image issue
* ui fix
* put back edit flag
* oops test fix
* reduce margins
* code review