Commit graph

246 commits

Author SHA1 Message Date
roomote[bot]
816dc75681
fix: improve Claude Code ENOENT error handling with installation guidance (#5867)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-07-31 10:45:16 -04:00
Daniel
ccd8ab9ffc
Fix: Kill button for execute_command tool (#6457) 2025-07-30 22:24:43 -04:00
roomote[bot]
93930643c6
feat: Add experimental setting to prevent editor focus disruption (#6214)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-07-28 23:14:53 -04:00
roomote[bot]
f45d9be709
fix: respect maxReadFileLine setting for file mentions to prevent context exhaustion (#6073)
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-25 16:45:45 -04:00
Hannes Rudolph
0323256006
feat: Add settings to control diagnostic messages (#5524) (#5582)
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2025-07-23 14:49:41 -04:00
Chris Estreich
9956cc1f48
Use SIGKILL for command execution timeouts in the "execa" variant (#6071) 2025-07-23 01:47:10 -07:00
roomote[bot]
37300ef0c5
fix: add character limit to prevent terminal output context explosion (#5777)
* 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>
2025-07-19 13:26:25 -04:00
roomote[bot]
b6bded9818
feat: add configurable delay for Go diagnostics to prevent premature error reporting (#5863)
* 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>
2025-07-18 16:12:00 -04:00
SannidhyaSah
824c49487b
feat: enable Claude Code provider to run natively on Windows (#5615) 2025-07-14 14:12:39 -04:00
Hannes Rudolph
f5dfbf1fc2
feat(claude-code): add configurable max output tokens setting (#5610)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-11 22:31:50 -04:00
Vivek Soni
7a8848de3b
fix: use decodeURIComponent in openFile (#5504)
* fix: use decodeURIComponent in openFile

* feat: add error handling for decodeURIComponent and tests

- Added try-catch block around decodeURIComponent to handle invalid escape sequences
- Falls back to original path if decoding fails
- Added comprehensive unit tests for the openFile function
- Tests cover invalid URI encoding, valid encoding, and various edge cases

* fix: update test to handle dynamic workspace paths in CI

* fix: handle Windows path separators in open-file tests

---------

Co-authored-by: Vivek Soni <vivex@Viveks-MacBook-Air-2.local>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-07-09 19:08:35 -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
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
Daniel
954825afb7
fix: Handle long Claude code messages (#5072) 2025-06-24 11:34:06 -04:00
Thomas Brugman
245c8f3269
Fix: Allow write_to_file to handle newline-only and empty content (#3550)
* Fix: Allow write_to_file to handle newline-only and empty content

* fix: update writeToFileTool to return early without error on missing or empty parameters

* fix: preserve newlines in content parameters and update error handling in writeToFileTool tests

* fix: update parseAssistantMessage and parseAssistantMessageV2 to preserve newlines in content parameters while stripping leading and trailing newlines

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-23 18:43:49 -04:00
Hannes Rudolph
cabf19153e
fix: resolve Claude Code provider JSON parsing and reasoning block display (#5049)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-23 14:14:20 -04:00
Hannes Rudolph
ff9b6b3ef6
feat: add Claude Code provider for local CLI integration (#4864)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-22 23:17:55 -04:00
Daniel
8eb147346d
fix: resolve diff editor issues with markdown preview associations (#4946) (#4980)
* fix: resolve diff editor issues with markdown preview associations (#4946)

- Pre-open files as text documents before executing diff command to avoid preview mode
- Update closeAllDiffViews to identify diff tabs by label pattern
- Add comprehensive tests for the new behavior

This ensures that files with custom editor associations (like markdown preview)
can be properly edited using Roo Code's diff editor tools.

* refactor: extract diff view label separator as shared constant

- Add DIFF_VIEW_LABEL_SEPARATOR constant to prevent breaking logic if string changes
- Update all usages in DiffViewProvider.ts and test file
- Addresses PR review feedback for better maintainability

* refactor: improve diff view label constant to include full text

- Rename DIFF_VIEW_LABEL_SEPARATOR to DIFF_VIEW_LABEL_CHANGES
- Include full 'Original ↔ Roo's Changes' text in constant for better maintainability
- Update all usages in DiffViewProvider.ts and test file
- Addresses feedback to make constant changes less awkward
2025-06-22 17:44:53 -04:00
Christiaan Arnoldus
bbbff7344b
feat(tools): Support for Excel (.xlsx) files (#4668) 2025-06-17 14:12:33 -04:00
Chris Estreich
62c3914034
Farewell jest (#4607)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-06-16 21:39:45 -07:00
Daniel
ec9b27d587
Resolve diff editor race condition in multi-monitor setups (#4578)
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: Mnehmos <Mnehmos@gmail.com>
2025-06-13 16:54:14 -04:00
axb
dfcf8fe760
add mermaid buttons (#4547)
* add mermaid buttons

* feat: Add Modal, TabButton, and ZoomControls components

* feat: Add error handling messages for image operations and file opening

* mermaid: Add drag functionality and support contious zooming

* add active color for tabbutton

* refactor zoom controls

* refactor: Remove unused svgToPng prop and simplify handleCopy function

* Move zoom to constants and increase max zoom

* feat: add save image functionality and refactor image handling

* feat: add translations

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-12 13:06:27 -04:00
Hannes Rudolph
c17a07d096
Fix: Reset terminal busy state after manual commands complete (#4583)
fix: reset terminal busy state after manual commands complete (#4319)

- Add terminal.busy = true when shell execution starts
- Add terminal.busy = false when shell execution ends for both Roo and non-Roo terminals
- Add comprehensive tests for busy flag management
- Fixes issue where terminals got stuck in busy state after manual commands
2025-06-12 11:09:08 -04:00
Chris Estreich
395f55b31f
Convert jest tests to vitest and disable default watch mode for vitest (#4568)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-06-11 14:48:01 -07:00
kiwina
f561208146
fix(WorkspaceTracker): Dispose FileSystemWatcher and other disposables to prevent resource leaks (#4237)
fix: auto patch for WorkspaceTracker_45
2025-06-04 16:57:54 -04:00
Sam Hoang Van
6baf28c328
feat(tools): add support for reading PDF, DOCX, and IPYNB files in read_file tool (#4288)
- Allow specific binary formats (.pdf, .docx, .ipynb) to be processed by extractTextFromFile
- Block unsupported binary files with existing "Binary file" notice
- Update tests to cover both supported and unsupported binary file scenarios
- Refactor test mocks for better maintainability and coverage
2025-06-03 11:59:34 -04:00
KJ7LNW
d079cb11ff
Fix directory link handling in markdown (#3690)
fix: improve directory link handling in markdown

Enhance the openFile function to better handle directory links in markdown:
- Add support for resolving ./SimpleName paths to home directory if not found in workspace
- Improve path resolution by checking multiple potential locations
- Ensure directories are properly revealed in the Explorer view
- Attempt to expand directories after revealing them

Fixes: #3686

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-01 22:59:17 -04:00
Matt Rubens
caf54dcc3d
Run prettier on src/ (#4221) 2025-06-01 22:56:47 -04:00
Matt Rubens
0f00982a2b
Revert "Revert "fix: prevent dump of an entire file into the context on user edit "" (#4219)
Revert "Revert "fix: prevent dump of an entire file into the context on user …"

This reverts commit 98f5542021.
2025-06-01 22:05:20 -04:00
Matt Rubens
98f5542021
Revert "fix: prevent dump of an entire file into the context on user edit " (#4211)
Revert "fix: prevent dump of an entire file into the context on user edit  (#…"

This reverts commit 5e50c5543b.
2025-06-01 16:51:32 -04:00
KJ7LNW
5e50c5543b
fix: prevent dump of an entire file into the context on user edit (#3654)
* refactor: Add pushToolWriteResult method to DiffViewProvider

Previously, each tool file contained duplicate code for formatting file write
responses and conditionally sending user_feedback_diff messages. This led to
inconsistent implementations and made changes difficult to maintain.

This refactoring centralizes the response formatting and messaging logic in the
DiffViewProvider class, which now:
- Stores results from saveChanges() in class properties
- Only sends user_feedback_diff when user edits exist
- Configures XMLBuilder with no indentation for cleaner output

Tool files now make a single method call instead of duplicating logic.

Fixes: #3647
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

* fix: conditionally show user edits message in file write response

Make the 'If the user's edits have addressed part of the task...' message
conditional based on whether there are actual user edits. This prevents
showing irrelevant guidance when no user edits were made to the file.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>

---------

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-01 09:55:40 -04: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
Ryan Pfister
177e7a8eb9
Fix UTF-8 encoding in ExecaTerminalProcess (#3989)
* Fix UTF-8 encoding issue in integrated terminal

- Set LANG and LC_ALL environment variables to en_US.UTF-8
- Resolves Encoding::CompatibilityError in Ruby/CocoaPods commands
- Ensures consistent UTF-8 encoding across all terminal sessions

This change addresses the terminal encoding issue where commands like
'pod install' would fail due to incompatible character encoding. The
fix ensures all integrated terminals are initialized with proper
UTF-8 locale settings.

* Add comprehensive unit tests for ExecaTerminalProcess UTF-8 encoding fix

- Tests verify LANG and LC_ALL are set to en_US.UTF-8
- Tests ensure existing environment variables are preserved
- Tests confirm UTF-8 settings override conflicting locale values
- Addresses PR feedback requesting test coverage for encoding fix
- All 7 tests passing with proper mocking of execa and ps-tree
2025-05-30 16:24:04 -04:00
மனோஜ்குமார் பழனிச்சாமி
5c4280c103
bugfix: Update PAGER env for Windows compatibility in Terminal (#3986)
Update PAGER environment variable for Windows compatibility in Terminal class
2025-05-28 15:05: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
avtc
ad2ff932fa
Fix handling BOM when user Rejects apply_diff (#3960)
Related issue is #1483, related pull request is #1500 - but it looks like it missed the revert of proposed diff case
2025-05-25 09:14:54 -04:00
KJ7LNW
82701584ae
fix: respect user-configured terminal integration timeout (#3886) 2025-05-22 22:34:33 -07:00
Chris Estreich
39cd50b989
Fix linter errors (#3821) 2025-05-21 23:16:43 -07:00
Chris Estreich
57249a0881
PNPM + Turbo monorepo + Nightly releases (#3407) 2025-05-21 21:01:20 -07:00
axb
3c73684729
fix: fix diffview scoll display (#3783) 2025-05-21 09:32:17 -04:00
xyOz
ad9c87a04f
Another grey screen fix. (#3644)
Memory memory memory
2025-05-20 22:27:46 -04:00
Chris Estreich
f274a150c4
Get package publisher and name from package.json + command type safety (#3766) 2025-05-20 16:41:03 -07:00
Noritaka Kobayashi
6a6df08fbd
refactor: import multiple times (#3745) 2025-05-20 09:19:44 -04:00
Remon Oldenbeuving
8721ab5dcd
fix(webview): Fix links to filename:0 (#3727)
* fix(webview): Fix links to filename:0

* Add changeset
2025-05-19 12:44:36 -07:00
Chris Estreich
9a358ab0f5
Focus improvements (#3539) 2025-05-13 09:41:03 -07:00
Chris Estreich
72358f2742
Add tests + benchmark for parseAssistantMessage V1 + 2 (#3538) 2025-05-13 08:05:41 -07:00
xyOz
86a03798d5
Greyscreen fix (#3474)
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-05-12 22:39:07 -04:00
Daniel
79d0e5039b
Handle directory URI on diagnostics (#3457) 2025-05-12 15:33:45 -07:00
Chris Estreich
7cea2e8bc4
Move presentAssistantMessage into its own module (#3345) 2025-05-08 11:59:03 -07:00
KJ7LNW
305185cd88
feat: clickable code references in model responses navigate to source lines (#3087)
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-05-05 14:33:18 -04:00