Commit graph

2325 commits

Author SHA1 Message Date
Daniel Riccio
3905dcbd5d
fix: address review comments - extract shared quota detection utility and fix translation typos 2025-07-04 17:38:37 -05:00
hannesrudolph
f2255d900d
fix: prevent indexer hanging on OpenAI insufficient quota errors (#5350) 2025-07-04 17:38:23 -05:00
Murilo Pires
a83e8c0553
feat: add markdown support to codebase indexing (#4660) (#5378)
* feat: add markdown support to codebase indexing (#4660)

* fix: implement chunking for large markdown sections and fix Qdrant deduplication issue (#4660)

- Modified parseMarkdownContent to chunk large sections (>1150 chars)
- Added support for chunking header-less markdown files
- Fixed _chunkTextByLines to handle oversized lines properly
- Added defensive check for parseMarkdown returning undefined
- Fixed Qdrant ID generation to use segmentHash instead of file:line
  - This was the root cause: chunks were being deduplicated
  - Each chunk now gets a unique ID even from the same line
- Added comprehensive tests for all edge cases
- Ensures all markdown content is properly indexed in Qdrant

* fix: remove redundant supported-extensions test file

As identified in PR review, the supported-extensions.spec.ts file only tests
the contents of an array, which is already implicitly covered by the functional
tests in parser.spec.ts. Removing this reduces maintenance overhead without
sacrificing test quality.

* test: address PR review feedback

- Remove redundant test 'should handle large markdown documentation folders efficiently'
  that only verified the scanner could iterate over mocked files
- Add test to verify unique point IDs are generated for each block from the same file,
  ensuring the segmentHash-based ID generation prevents collisions

* fix: add segmentHash to vector point payload and refactor tests

- Add segmentHash to payload in scanner.ts to fix vector point ID generation
- Split parser.spec.ts tests into focused unit tests (mocked dependencies)
- Move integration tests to new markdownIntegration.spec.ts file
- Each test suite now has clear, distinct responsibilities
- Fixes issue #4660: vector point ID collisions for large Markdown files

* refactor: move redundant tests

* feat: enhance markdown processing with consistent chunking logic and segment hashing

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-04 13:58:25 -04:00
lhish
8e7d9e092d
fix(tools): Resolve intermittent hangs and lack of clear error feedback in apply_diff tool (#5391)
* fix(tools): Resolve intermittent hangs and lack of clear error feedback in apply_diff tool (#5390)

* fix: show user-friendly error message for XML parsing failures

- Keep detailed XML structure instructions only for LLM via pushToolResult
- Show simple error message to user via cline.say
- Aligns with established error handling pattern in codebase

* feat: add telemetry for XML parsing errors

- Track XML parsing errors using captureDiffApplicationError
- Include consecutive mistake count for better error analysis
- Helps monitor and debug XML parsing issues in production

---------

Co-authored-by: Example User <user@example.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-04 10:02:28 -04:00
Hannes Rudolph
ede228e152
fix: prevent chatbox focus loss during automated file editing (#4574) (#5349)
* fix: prevent chatbox focus loss during automated file editing (#4574)

- Add preserveFocus: true to DiffViewProvider openDiffEditor method
- Implement comprehensive focus preservation during cursor positioning and scrolling
- Make scrollToFirstDiff async with focus restoration capabilities
- Update all tool files to use async scrollToFirstDiff
- Add comprehensive unit and E2E tests for focus preservation

Fixes #4574

* refactor: extract focus restoration logic and improve consistency

- Created restoreEditorFocus() helper method to eliminate code duplication
- Changed preserveFocus from false to true for consistent behavior
- Added error handling with silent logging for focus restoration failures
- Added null checks for undefined activeTextEditor cases

* Delete apps/vscode-e2e/src/suite/tools/focus-preservation.test.ts

It doesn't seem to be testing anything

* refactor: remove focus restoration logic to simplify diff editor interactions

* refactor: remove unnecessary await from scrollToFirstDiff calls

---------

Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-03 20:43:06 -04:00
Daniel
e508eaf3df
Fix code index secret persistence and improve settings UX (#5158)
* Fix code index secret persistence with async VSCode storage

- Add async secret methods to CodeIndexConfigManager
- Implement direct VSCode secret storage access bypassing ContextProxy cache
- Update loadConfiguration to use async secret loading
- Modify webview message handler to use new async secret storage
- Add public secret methods to CodeIndexManager
- Enhance debugging throughout secret flow

This fixes the issue where API keys were saved but not loaded immediately
into services due to ContextProxy cache synchronization issues.

* Fix code index secret persistence and test failures

- Add async secret handling to CodeIndexConfigManager with new methods:
  - getSecretAsync(), storeSecretAsync() for individual secrets
  - loadSecretsAsync(), storeSecretsAsync() for batch operations
- Update doesConfigChangeRequireRestart() to check OpenAI Compatible modelDimension changes
- Fix all failing tests by using setupSecretMocks() helper consistently
- Update manager.spec.ts to properly mock _recreateServices to avoid real service creation

This ensures API keys and other secrets are properly loaded from VSCode's async secret storage
and that configuration changes requiring service restart are correctly detected.

* feat: improve code index settings secret handling in UI

- Show placeholder dots (••••••••••••••••) in password fields when secrets are already set
- Only send modified secret fields to prevent overwriting existing secrets with empty values
- Track which fields have been modified by the user
- Add requestCodeIndexSecretStatus message handler to check if secrets exist
- Fix console.log to handle empty string keys without errors
- Ensure changing one setting doesn't clear other unmodified secrets

* refactor: disconnect code index from unified settings system

- Rename handleExternalSettingsChange to handleSettingsChange for clarity
- Remove handleSettingsChange call from ClineProvider (not related to code index)
- Remove codebaseIndexConfig from general settings save in SettingsView
- Delete unused codebaseIndexConfig message handler
- Remove codebaseIndexConfig from WebviewMessage type definition
- Code index settings are now fully independent with their own dedicated UI

* feat: separate code index enable/disable from indexing settings

- Move 'Enable codebase indexing' toggle to global settings in Experimental section
- Keep indexing-specific settings (API keys, URLs, models) in dedicated Code Index Settings component
- Add codebaseIndexEnabled handler to webview message handler
- Update translations with new settings title and disabled message
- Ensure code index service properly responds to enable/disable changes
- Maintain backward compatibility with existing codebaseIndexConfig structure

* refactor: remove ContextProxy.getVSCodeContext() and pass ExtensionContext directly

- Updated CodeIndexConfigManager to accept vscode.ExtensionContext in constructor
- Modified CodeIndexManager to pass context directly to CodeIndexConfigManager
- Updated webviewMessageHandler to use provider.context.secrets directly
- Removed getVSCodeContext() method from ContextProxy
- Updated all related tests to reflect these changes
- Fixed CodeIndexSettings webview tests after UI changes

* refactor: streamline secret handling by removing async methods and utilizing ContextProxy directly

* feat: translations and popover component

* refactor: simplify test mocks and improve checkbox handling in CodeIndexSettings tests

* refactor: remove debug logging from CodeIndexConfigManager, CodeIndexManager, CodeIndexServiceFactory, and QdrantVectorStore

* fix: merge missing translation keys from main after rebase

- Add advancedConfigLabel, searchMinScoreLabel, searchMinScoreDescription, searchMinScoreResetTooltip keys
- Update startIndexingButton and clearIndexDataButton labels to match main
- Preserve all CodeIndexPopover translations added in this PR

* Revert "fix: merge missing translation keys from main after rebase"

This reverts commit beb1de4924ac1475731fcd06d994ddb96eb1e5fd.

* fix: add missing translation keys from main branch after rebase

- Added codeIndex.advancedConfigLabel
- Added codeIndex.searchMinScoreLabel
- Added codeIndex.searchMinScoreDescription
- Added codeIndex.searchMinScoreResetTooltip

These keys exist on main but were missing from non-English locales after rebase.

* fix: remove clickIndicatorMessage, fix toggle message type, and clean up translation key inconsistencies

* refactor: streamline settings management in CodeIndexPopover and improve secret handling

* refactor: remove debug logging from configuration checks in CodeIndexConfigManager and webviewMessageHandler

* fix: translations

* refactor: remove CodeIndexSettings component and associated tests
2025-07-03 18:33:20 -04:00
Hannes Rudolph
329690cf54
feat: Delete .roo/rules-{mode} folder when custom mode is deleted (#5210) (#5317)
* feat: Add folder deletion when custom mode is deleted (#5210)

* fix: address PR feedback - fix Korean translation typo and add missing German translation

* fix: use os.homedir() instead of vscode.env.userHome

* fix: use dynamic home directory in webview tests for cross-platform compatibility

* fix: normalize path separators in tests for Windows compatibility

* feat: implement DeleteModeDialog component for mode deletion confirmation

* fix: use ref to store current modeToDelete value for consistent state handling

* feat: add error handling for rules folder deletion and localize error messages

* Update src/i18n/locales/ja/common.json

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

* Update src/i18n/locales/zh-CN/common.json

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

* fix: remove redundant rulesFolderExists from deleteCustomModeCheck response

* fix: update webviewMessageHandler tests to match fs import style

---------

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>
2025-07-03 13:00:07 -04:00
SannidhyaSah
37619d7850
fix: support full endpoint URLs in OpenAI Compatible provider (#5212) (#5214)
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-07-02 23:58:35 -04:00
SannidhyaSah
87aa688f33
feat: add Gemini embedding provider for codebase indexing (#5228)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-02 23:51:42 -04:00
WuWen
19cd001f8d
fix access_mcp_resource fails to handle images correctly (#5254) 2025-07-02 23:50:15 -04:00
github-actions[bot]
6355cb010c
Changeset version bump (#5358)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-07-02 17:20:21 -04:00
Matt Rubens
cb44e6dda4
v3.22.6 (#5357) 2025-07-02 17:15:40 -04:00
Matt Rubens
1be6fce1a6
Check for protected files in single apply diff (#5348) 2025-07-02 13:52:13 -04:00
Matt Rubens
3993406ebd
Add .vscode/ to the list of write-protected files/directories (#5347) 2025-07-02 13:17:20 -04:00
Hannes Rudolph
70726bcd21
feat: Import export modes (#5074)
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-01 17:13:44 -04:00
SannidhyaSah
ff1e8ac2ee
fix: remove context size from environment details (#5165) (#5312)
Co-authored-by: Matt Rubens <mrubens@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-01 15:14:50 -04:00
Will Li
781beeb30f
Auto approve follow up questions (#5296) 2025-07-01 14:43:16 -04:00
Hannes Rudolph
a348a2ae9a
feat: add user-configurable search score threshold slider for semantic search (#5027) (#5041)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-01 14:41:23 -04:00
Murilo Pires
933f28fe32
fix: Exclude cache files from rules compilation (#5283)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-07-01 10:33:32 -04:00
roomote
951f2d0fad
Fix #5294: Prevent Architect mode from providing time estimates (#5295)
* Fixes #5294: Add instruction to Architect mode to avoid time estimates

- Updated Architect mode custom instructions to explicitly prohibit providing time estimates
- Added clear guidance to focus on actionable plans without speculating about implementation timeframes
- Updated test snapshot to reflect the new instruction
- All tests passing

* More tweaks to prompt

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-07-01 09:42:46 -04:00
Andrew Shu
569b276d93
feat: adding default headers and testing for litellm fetcher (#5242)
* chore: adding x-title header and testing for litellm

* chore: indentation fi and headers order fix

* chore: spacing fix

* chore: removed white space

* fix: allow user headers to override default headers and clean up formatting

- Reorder header spread in router-provider.ts so user-provided openAiHeaders can override DEFAULT_HEADERS
- Remove unnecessary blank lines after imports for consistency
- This matches the pattern used in openai.ts where DEFAULT_HEADERS come first

---------

Co-authored-by: Brendan-Z <brendanzhou.99@gmail.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-30 20:23:11 -04:00
Hannes Rudolph
18c3f5dc33
feat: change default mode to architect for new installations (#5289)
* feat: change default mode to architect for new installations

- Reordered modes array to put architect mode first
- Updated test to reflect architect as the default mode
- Maintains backward compatibility for existing users

* test: update snapshots and fix tests for architect default mode

- Update all snapshot tests to reflect architect as the default mode
- Fix mode destructuring in validateToolUse tests
- All tests now pass with the new default mode configuration

* docs: add comment explaining mode ordering for default selection

Addresses PR review feedback to clarify that the first mode in the array
serves as the default for new installations

* fix: Update integration test to use lowercase mode name

The test was using 'Ask' (capitalized) but modes are now lowercase 'ask'.
This was causing the test to timeout as the mode validation failed.
2025-06-30 17:46:56 -04:00
Murilo Pires
b9626a7eff
fix: cap API retry exponential backoff at 10 minutes (#5171)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-30 10:56:34 -04:00
Kevin Zhao
000a9e5268
feat: update AWS Bedrock cross-region inference profile mapping, Closed issue #2704 (#4973) 2025-06-30 10:49:32 -04:00
roomote
fb711a097c
Fixes #4903: Consistent cancellation error messages for thinking vs streaming phases (#4904)
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-06-30 10:48:57 -04:00
takakoutso
562a007438
feat: Add automatic configuration import on extension startup (#4848)
Co-authored-by: Roo Code <chris@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-30 10:45:51 -04:00
Murilo Pires
64279166c4
fix: resolve URL loading timeout issues in @ mentions (#5160)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-30 10:40:53 -04:00
PaperBoardOfficial
8c493b393f
fixed profile context condensation threshold (#5230) 2025-06-30 10:37:18 -04:00
roomote
cd60bb3a7e
Fixes #5206: Update apply_diff tool documentation to accurately reflect multi-file capabilities (#5232)
* Fixes #5206

* Fix failing test: Update snapshot after documentation changes

- Updated system-prompt.spec.ts snapshot to match new tool descriptions
- Changes reflect updated multi-file diff strategy documentation
- Addresses test failure mentioned in PR #5232 comment by @mrubens
2025-06-30 09:01:44 -04:00
github-actions[bot]
b45252d490
Changeset version bump (#5225)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-29 01:06:59 -04:00
Matt Rubens
d64e677f88
Remove Gemini CLI provider (#5223) 2025-06-28 23:48:28 -04:00
Matt Rubens
f763a5119b
Revert "Stop double-capturing cloud telemetry" (#5220) 2025-06-28 16:03:56 -04:00
Will Li
dc44e7a40b
Git Repo URL telemetry link fix: only Https (#5202)
* https parsing in URL sanatizing for git repo

* fix: remove duplicate JSDoc and add SSH to HTTPS conversion test

- Remove duplicate JSDoc comment from convertGitUrlToHttps function
- Add test case to verify getGitRepositoryInfo converts SSH URLs to HTTPS format

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-28 09:32:27 -04:00
Matt Rubens
8bb7ef083f
Stop double-capturing cloud telemetry (#5211) 2025-06-28 00:49:01 -04:00
github-actions[bot]
fa693e1f06
Changeset version bump (#5205)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-27 20:20:03 -04:00
Johannes
de99e348df
fix: resolve E2BIG error by passing large prompts via stdin to Claude CLI (#5186)
* fix: resolve E2BIG error by passing large prompts via stdin to Claude CLI

- Pass messages via stdin instead of command line arguments to avoid Linux argument length limits
- Add --input-format text flag to claude CLI command
- Update execa configuration to use stdin pipe
- Fix corresponding unit tests with proper async iterator mocking
- Resolves spawn E2BIG errors when using very large conversation histories

* fix: address race condition and improve error handling

- Use setImmediate to ensure process is spawned before writing to stdin
- Add proper error handling for stdin write operations
- Add tests for error scenarios
- Update existing tests to handle async behavior properly

* fix: remove --input-format text flag to prevent CLI parsing errors

The --input-format text flag was causing the Claude CLI to misinterpret
the JSON content passed via stdin, leading to errors like 'unknown option -------'
when the system prompt contained dashes. Removing this flag allows the CLI
to properly handle the JSON input via stdin.

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-27 20:07:04 -04:00
Matt Rubens
719d661478
Add optional mode suggestions to follow-up questions (#5200) 2025-06-27 16:26:17 -04:00
github-actions[bot]
3a8ba27615
Changeset version bump (#5196)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-27 15:45:28 -04:00
Daniel
d397d131b9
fix: restore JSON backwards compatibility for .roomodes files (#5199) 2025-06-27 15:04:17 -04:00
github-actions[bot]
f1feccc6bf
Changeset version bump (#5167)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-27 12:58:44 -04:00
Daniel
0ddd21e8fb
fix(i18n): correct gemini cli error translation paths (#5194) 2025-06-27 12:23:21 -04:00
Catriel Müller
426518bccd
Code Index (Qdrant) recreate services when change configurations (#5152) 2025-06-27 10:20:38 -04:00
Murilo Pires
9bf31d3ff7
fix terminal keyboard shortcut error when adding content to context (#5161)
## Fix terminal keyboard shortcut error when adding content to context

**Fixes:** [#2276](https://github.com/RooCodeInc/Roo-Code/issues/2276)

**Problem:**
- Using keyboard shortcuts to add terminal content to context threw error: "Cannot read properties of undefined (reading 'selection')"
- Context menu worked correctly, but keyboard shortcuts failed

**Root Cause:**
- Command handler accessed `args.selection` without null checking
- When triggered via keyboard shortcut, VS Code passes `undefined` for `args` parameter
- When triggered via context menu, VS Code passes an object with `selection` property

**Solution:**
- Changed `args.selection` to `args?.selection` using optional chaining
- Maintains existing fallback behavior when no selection is available
- Preserves backward compatibility with context menu functionality

**Files Modified:**
- `src/activate/registerTerminalActions.ts` - Added null safety for args parameter

**Testing:**
-  Keyboard shortcuts now work without errors
-  Context menu functionality preserved
-  Fallback to `Terminal.getTerminalContents()` works in both scenarios
2025-06-26 20:34:14 -04:00
github-actions[bot]
43357967f0
Changeset version bump (#5166)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-26 20:19:18 -04:00
Hannes Rudolph
992997c02f
feat: add Gemini CLI provider for free access to Gemini models (#5134) (#5137)
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: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-06-26 16:03:18 -04:00
axb
5c9b476d5b
fix undefined mcp command (#5107) 2025-06-26 12:25:15 -04:00
Christiaan Arnoldus
1a9aa13bd2
Use upstream_inference_cost for OpenRouter BYOK cost calculation and show cached token count (#5145)
Improve OpenRouter cache calculation and show cached tokens
2025-06-26 10:18:49 -04:00
github-actions[bot]
c4594cc60f
Changeset version bump (#5131)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-25 21:55:56 -04:00
Hannes Rudolph
f9f01b012c
fix: resolve Claude Code token counting inefficiency and enable caching (#5104) (#5108)
* fix: resolve Claude Code token counting inefficiency and enable caching (#5104)

- Remove 1.5x fudge factor from Claude Code token counting
- Enable prompt caching support for all Claude Code models
- Add comprehensive tests for token counting and caching
- Update existing tests to reflect accurate token counting

This fixes the extreme token inefficiency where simple messages would
jump from ~40k to over 60k tokens, causing API hangs when approaching
the artificial 120k limit. Claude Code now properly utilizes its full
200k context window with accurate token counting.

* fix: address PR review comments

- Extract IMAGE_TOKEN_ESTIMATE as a named constant for clarity
- Update token counting tests to use exact counts instead of ranges for deterministic testing
- Fix test expectations to match actual tokenizer output

* Remove token counting changes, keep only cache support

- Removed custom countTokens override from claude-code.ts
- Deleted claude-code-token-counting.spec.ts test file
- Kept cache token collection and reporting functionality
- Kept supportsPromptCache: true for all Claude Code models
- Kept claude-code-caching.spec.ts tests

This focuses the PR on enabling cache support without modifying token counting behavior.

* fix: update webview test to expect supportsPromptCache=true for Claude Code models

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-25 20:36:06 -04:00
ExactDoug
889e92518b
Fix: Remove temperature parameter for Azure OpenAI reasoning models (#5116)
* Fix temperature parameter error for Azure OpenAI reasoning models

* Fix tests: Update O3 family model tests to expect temperature: undefined

- Updated failing tests in openai.spec.ts to expect temperature: undefined for O3 models
- This aligns with the PR changes that remove temperature parameter for Azure OpenAI o1, o3, and o4 models
- All 4 previously failing tests now pass

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-25 20:23:45 -04:00