Commit graph

4875 commits

Author SHA1 Message Date
Daniel Riccio
84d4eb6d53 refactor(tests): migrate safeWriteJson tests from Jest to Vitest and improve error handling 2025-06-21 13:52:32 -05:00
Daniel Riccio
0714c48a9e chore: update pnpm-lock.yaml after rebase 2025-06-21 13:48:48 -05:00
Eric Wheeler
4c03145cf9 test: update cache-manager tests to use safeWriteJson
Updated the cache-manager tests to properly mock the safeWriteJson utility
instead of expecting vscode.workspace.fs.writeFile calls. This fixes test
failures that occurred after the implementation was changed to use safeWriteJson.

The changes include:
- Adding proper mocking for safeWriteJson
- Updating all test expectations to check for safeWriteJson calls
- Changing how test data is verified to match the new implementation

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
d5f8c5fd5e refactor: replace JSON.stringify with safeWriteJson for file operations
Replace all non-test instances of JSON.stringify used for writing to JSON files with safeWriteJson to ensure safer file operations with proper locking, error handling, and atomic writes.

- Updated src/services/mcp/McpHub.ts
- Updated src/services/code-index/cache-manager.ts
- Updated src/api/providers/fetchers/modelEndpointCache.ts
- Updated src/api/providers/fetchers/modelCache.ts
- Updated tests to match the new implementation

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
7d23a8ddf4 fix: race condition in safeWriteJson directory handling
Fix race condition where safeWriteJson would fail with ENOENT errors
during lock acquisition when the parent directory was just created.

The issue occurred when the directory creation hadn't fully synchronized
with the filesystem before attempting to acquire a lock. This happened
primarily when Task.saveApiConversationHistory() called the function
immediately after creating the task directory.

The fix ensures directories exist and are fully synchronized before
lock acquisition by:
- Creating directories with fs.mkdir({ recursive: true })
- Verifying access to created directories
- Setting realpath: false in lock options to allow locking non-existent files

Added comprehensive tests for directory creation capabilities.

Fixes: #4468
See-also: #4471, #3772, #722

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
4d5668962b docs: add rules for using safeWriteJson
Add concise rules for using safeWriteJson instead of JSON.stringify with file operations to ensure atomic writes and prevent data corruption.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
dd5410803a test: update tests to work with safeWriteJson
Updated tests to work with safeWriteJson instead of direct fs.writeFile calls:

- Updated importExport.test.ts to expect safeWriteJson calls instead of fs.writeFile
- Fixed McpHub.test.ts by properly mocking fs/promises module:
  - Moved jest.mock() to the top of the file before any imports
  - Added mock implementations for all fs functions used by safeWriteJson
  - Updated the test setup to work with the mocked fs module

All tests now pass successfully.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
ca0afb2fbb test: fix safeWriteJson test failures
- Ensure test file exists before locking
- Add proper mocking for fs.createWriteStream
- Fix test assertions to match expected behavior
- Improve test comments to follow project guidelines

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
fdccf09bc1 fix: improve safeWriteJson locking mechanism
- Use file path itself for locking instead of separate lock file
- Improve error handling and clarity of code
- Enhance cleanup of temporary files

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:09 -05:00
Eric Wheeler
b6cd1afbcc feat: implement streaming JSON write in safeWriteJson
Refactor safeWriteJson to use stream-json for memory-efficient JSON serialization:
- Replace in-memory string creation with streaming pipeline
- Add Disassembler and Stringer from stream-json library
- Extract streaming logic to a dedicated helper function
- Add proper-lockfile and stream-json dependencies

This implementation reduces memory usage when writing large JSON objects.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:47:05 -05:00
Eric Wheeler
1bca55ef2c feat: Implement inter-process file locking for safeWriteJson
Replaces the previous in-memory lock in `safeWriteJson` with
`proper-lockfile` to provide robust, cross-process advisory file
locking. This enhances safety when multiple processes might attempt
concurrent writes to the same JSON file.

Key changes:
- Added `proper-lockfile` and `@types/proper-lockfile` dependencies.
- `safeWriteJson` now uses `proper-lockfile.lock()` with configured
  retries, staleness checks (31s), and lock update intervals (10s).
- An `onCompromised` handler is included to manage scenarios where
  the lock state is unexpectedly altered.
- Logging and comments within `safeWriteJson` have been refined for
  clarity, ensuring error logs include backtraces.
- The test suite `safeWriteJson.test.ts` has been significantly
  updated to:
    - Use real timers (`jest.useRealTimers()`).
    - Employ a more comprehensive mock for `fs/promises`.
    - Correctly manage file pre-existence for various scenarios.
    - Simulate lock contention by mocking `proper-lockfile.lock()`
      using `jest.doMock` and a dynamic require for the SUT.
    - Verify lock release by checking for the absence of the `.lock`
      file.

All tests are passing with these changes.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:46:18 -05:00
Eric Wheeler
4b774b9961 fix: use safeWriteJson for all JSON file writes
This change refactors all direct JSON file writes to use the safeWriteJson
utility, which implements atomic file writes to prevent data corruption
during write operations.

- Modified safeWriteJson to accept optional replacer and space arguments
- Updated tests to verify correct behavior with the new implementation

Fixes: #722
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:46:15 -05:00
Eric Wheeler
ac619f106b feat: Add safeWriteJson utility for atomic file operations
Implements a robust JSON file writing utility that:
- Prevents concurrent writes to the same file using in-memory locks
- Ensures atomic operations with temporary file and backup strategies
- Handles error cases with proper rollback mechanisms
- Cleans up temporary files even when operations fail
- Provides comprehensive test coverage for success and failure scenarios

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-06-21 13:42:56 -05:00
github-actions[bot]
6a9503da1d
Update contributors list (#4955)
docs: update contributors list [skip ci]

Co-authored-by: mrubens <2600+mrubens@users.noreply.github.com>
2025-06-21 13:23:36 -04:00
Matt Rubens
df2871be18
Remove type of change from PR template (#4987)
Remove type of change section from PR template

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-06-21 13:22:50 -04:00
Matt Rubens
5b501d0e84
Simplify PR template checklist for code quality and testing (#4985)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-06-21 13:09:01 -04:00
Matt Rubens
95497a72c7
Filter out additional bot and automated accounts from contributors list (#4983)
* Filter out additional bot and automated accounts from contributors list

* [Ellipsis] fix: exclude `cursor` and `roomote` logins in contributors section (#4984)

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-06-21 13:08:35 -04:00
cursor[bot]
d838109aa3
Remove changeset requirement from PR template (#4982)
- Remove the changeset checklist item from PR template as requested
- Contributors no longer need to create changesets for PRs
- Automated changeset workflows remain in place for version management

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-06-21 12:37:52 -04:00
Daniel
ef19082acd
feat: add PR Fixer mode for resolving pull request issues (#4961)
* feat: add PR Fixer mode for resolving pull request issues

- Add new PR Fixer mode to help address feedback and resolve issues in existing PRs
- Include workflow instructions for analyzing PR comments, failing tests, and merge conflicts
- Add best practices and common patterns for PR resolution
- Include tool usage guidelines and examples
- Add custom instructions for handling merge conflict markers in diffs

* refactor: remove duplicate custom instructions
2025-06-21 12:11:53 -04:00
Chris Estreich
bccf11f2eb
Increase suite-level e2e test timeout (#4975) 2025-06-21 00:57:13 -07:00
Chris Estreich
00ad4256d1
Fix flakey ModelPicker test (#4972) 2025-06-21 00:34:08 -07:00
renovate[bot]
86ce767688
fix(deps): update dependency serialize-error to v12 (#4832)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-20 23:15:19 -04:00
renovate[bot]
d049634263
fix(deps): update dependency tailwind-merge to v3 (#4834)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-20 23:14:57 -04:00
renovate[bot]
15d5af6919
fix(deps): update dependency pretty-bytes to v7 (#4806)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-20 23:14:01 -04:00
renovate[bot]
40883a6dd9
chore(deps): update dependency mocha to v11.7.0 (#4944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-20 23:13:41 -04:00
renovate[bot]
5238a515df
chore(deps): update dependency globals to v16.2.0 (#4943)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-20 23:13:28 -04:00
SannidhyaSah
7392f14e44
feat: add profile-specific context condensing thresholds (#4456)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-06-20 23:02:04 -04:00
Brad Davis
37ed013157
fix context length for lmstudio and ollama (#2462) (#4314)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 22:53:04 -04:00
github-actions[bot]
a24b7210e4
Changeset version bump (#4963)
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-20 22:51:05 -04:00
Matt Rubens
6736d81913
v3.21.2 (#4964) 2025-06-20 22:45:08 -04:00
roomote
133af6ae64
Fix #4958: Increase vitest timeout for Windows CI (#4959)
Co-authored-by: Chris Estreich <cestreich@gmail.com>
2025-06-20 17:14:42 -07:00
Ksandr
d99ae582d0
feature: add toggle for disable mcp server tool from prompt (#3551)
* add toggle for disable mcp server tool from prompt

* languages

* fix error message

* Update src/core/prompts/instructions/create-mcp-server.ts

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

* fix build

* typo

* refactor: make the switch style consistent

* respect review

* refactor: improve layout and styling in McpToolRow component

* fix: update new mcp tests

* tailwind css for disabledTool swipper

* id locale (from main)

* fix: improve error message for updating tool settings

* fix: specify type for serverConfigData as Record<string, any>

* fix: enhance UI layout and improve accessibility for tool controls

* fix: migrate jest.Mock to vitest Mock type

* Update .changeset/slimy-years-smell.md

* fix: replace enabled switch with button

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@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-20 19:14:59 -04:00
John Richmond
805fe7021d
It's compliant if you're on your first attempt to fetch a session token (#4957) 2025-06-20 16:06:35 -07:00
roomote
6ed217c716
Fixes #4882: Remove experimental setting for command execution in attempt_completion (#4884)
* Fixes #4882: Remove experimental setting for command execution in attempt_completion

- Remove DISABLE_COMPLETION_COMMAND from experiments system
- Permanently disable command execution in attempt_completion tool
- Update tool prompts to remove command parameter and examples
- Remove experimental UI toggle and localization entries (18+ languages)
- Update tests to reflect permanent behavior
- Remove experiment-specific test file

Command execution is now permanently disabled in attempt_completion.
Users must use execute_command tool separately before attempt_completion.

* refactor: simplify getAttemptCompletionDescription by removing unnecessary variables

* test: fix tests by regenerating snaps

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 17:48:01 -04:00
xyOz
93b8f6d87f
Update MarkdownBlock.tsx (#4841)
* Update MarkdownBlock.tsx

* fix: correct URL handling in MarkdownBlock and add tests for trailing punctuation

* Fix URL punctuation rendering

* fix: improve URL handling in MarkdownBlock and update tests for trailing punctuation

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 17:46:38 -04:00
Daniel
9da598c9db
fix: update MarketplaceViewStateManager test to match default isFetching state (#4954)
The test was expecting isFetching to be false in the default state, but the implementation correctly initializes it as true to show a loading state on initial load. Updated the test expectation to match the actual behavior.
2025-06-20 13:36:26 -07:00
github-actions[bot]
2f30af00b4
Update contributors list (#4845)
Co-authored-by: mrubens <2600+mrubens@users.noreply.github.com>
2025-06-20 15:47:01 -04:00
roomote
ce2cfe6df0
Fixes #4855: Rename 'Boomerang Tasks' to 'Task Orchestration' for clarity (#4856) 2025-06-20 15:45:58 -04:00
Hannes Rudolph
85d73af334
feat: add LaTeX math equation rendering in chat window (#4258) (#4786)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 15:45:18 -04:00
roomote
d598fc3795
Fixes #4794: Fix marketplace blanking after populating (#4796)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 15:42:36 -04:00
Hannes Rudolph
7a8483dc12
fix: add symlink support to list_files tool (#4654) (#4859)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 15:26:55 -04:00
peng
5012922a18
Fix recursive directory scanning in @ mention "Add Folder" functionality (#4863) 2025-06-20 15:24:37 -04:00
Matt Rubens
8370591ec0
Display the organization image in the account view (#4953) 2025-06-20 15:14:18 -04:00
Daniel
9a5f6ce7ea
fix: resolve marketplace timeout issues and display installed MCPs (#4817) (#4941) 2025-06-20 13:20:02 -04:00
Matt Rubens
d1eecb9084
Fix logo centering (#4945) 2025-06-20 12:56:35 -04:00
John Richmond
b31250d128
Scope dev RCC credentials by dev url (#4922) 2025-06-19 22:34:04 -07:00
dleffel
68e38e8db8
feat: add Terms of Service page at /terms (#4920) 2025-06-20 00:56:14 -04:00
Chris Estreich
53e6419fab
Fix roocode.com Vercel preview on PR open (#4916) 2025-06-19 20:00:11 -07:00
Matt Rubens
b6bbb1e95b
Add choice to share with organization or publicly (#4899) 2025-06-19 22:29:42 -04:00
dleffel
9e5ecb18f7
Update enterprise page with control-plane messaging (#4914) 2025-06-19 22:11:19 -04:00