Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Apr 22, 2025

Context

I was looking at what kind of performance win we'd get by using a YAML / append for our task files instead of JSON and noticed that we call this a lot more than we need to, and it's a pretty expensive call.

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Throttle task folder size calculation and enhance environment variable handling, with UI improvements for model selection and task management.

  • Behavior:
    • Throttle task folder size calculation in Cline class in Cline.ts to reduce performance overhead.
    • Add injectEnv() function in config.ts to replace environment variables in strings and objects.
  • UI Components:
    • Add Mention component in Mention.tsx for handling text mentions.
    • Add TaskActions component in TaskActions.tsx for task export and deletion.
    • Add ContextWindowProgress component in ContextWindowProgress.tsx for visualizing token usage.
    • Update TaskHeader.tsx to use new components and improve task display.
    • Enhance ModelPicker.tsx and ApiOptions.tsx for better model selection and configuration.
  • Tests:
    • Add tests for injectEnv() in config.test.ts to ensure correct environment variable replacement.
  • Misc:
    • Update validate.ts to include new validation logic for API configurations.

This description was created by Ellipsis for 2028dc7. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Apr 22, 2025

🦋 Changeset detected

Latest commit: 2028dc7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Apr 22, 2025
try {
this.taskDirSize = await getFolderSize.loose(taskDir)
this.taskDirSizeCheckedAt = Date.now()
} catch (err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When throttling the folder size calculation, if getFolderSize.loose(taskDir) fails (lines 392-400), the catch block logs the error but does not update taskDirSizeCheckedAt. This may result in repeated calls if the error persists. Consider updating taskDirSizeCheckedAt in a finally block (or even on error) to avoid continuous retries.

This comment was generated because it violated a code review rule: mrule_OR1S8PRRHcvbdFib.

Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ellipsis comments make sense to me, but LGTM otherwise. Good find!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 23, 2025
@RooCodeInc RooCodeInc deleted a comment from ellipsis-dev bot Apr 23, 2025
daniel-lxs and others added 19 commits April 23, 2025 11:38
* feat: allow variable interpolation into the custom system prompt

* fix: allow the test to pass on windows by using the path module
* fix: allow opening files without workspace root

The openFile function in open-file.ts was requiring a workspace root to be present,
which prevented opening global files (like MCP settings) when no workspace was open.
Modified the function to handle absolute paths without this requirement.

Previously, trying to open MCP settings in a new window without a workspace would
error with "Could not open file: No workspace root found". Now the function
properly handles both workspace-relative and absolute paths, allowing global
settings files to be accessed in any context.

Changes:
- Removed workspace root requirement in openFile
- Added fallback for relative paths when no workspace is present

* fix: update openFile function to use provided path without modification

---------

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>
)

- Maintains editor view column state when closing and reopening files during diff operations, ensuring tabs stay opened in their original position.

- Prevents closing the original editor tab when opening the diff view, preserving pinned status when applying changes via write_to_file or apply_diff.

- Updates VSCode workspace launch flag from -n to -W for compatibility.
* feat: initialize VS Code Language Model client in constructor

* feat: add VS Code LLM models and configuration

* feat: integrate VS Code LLM models into API configuration normalization

* Fix tests

---------

Co-authored-by: Matt Rubens <[email protected]>
* Fix: focusInput open roo code panel (#2626)

* Fix: `roo-cline.focusInput` open roo code panel

* fixup! Fix: focusInput open roo code panel (#2626)
* feat: support environment variables reference in mcp `env` config

* tests(src/utils/config): add test for `injectEnv`

* fix(injectEnv): use `env == null` and `??` check instead of `!env`, `||`

* refactor: remove unnecessary type declare

* chore!: simplify regexp, remove replacement for env vars with dots
docs: update contributors list [skip ci]

Co-authored-by: mrubens <[email protected]>
The FakeAI object passed by the user must be exactly the same object
that is passed to FakeAIHandler via API configuration.
Unfortunatelly, as the VSCode global state is used as configuration
storage, we lose this property (VSCode global state creates copies of
the object). Also the class of the stored object is lost, so methods
of the object are unavailable.

Therefore, we store the original objects in global variable and
use ID field of FakeAI object to identify the original object.
* feat: Removed unnecessary cost calculation

* Update vscode-lm.ts

---------

Co-authored-by: Matt Rubens <[email protected]>
* Update validate.ts

Allow ARNs from Bedrock Marketplace, which are different because models are deployed using SageMaker Inference behind the scenes.

* Update bedrock.ts

Allow ARNs from Bedrock Marketplace, which are different because models are deployed using SageMaker Inference behind the scenes.
* OpenRouter Gemini caching

* Fix tests

* Remove unsupported models

* Clean up the task header a bit

* Update src/api/providers/openrouter.ts

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

* Remove model that doesn't seem to work

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* fix(chat): better loading feedback

* fix(chat): missing loading aria role

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

* refactor(chat): use vscode loading for more consistency

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Package material icons in vsix

* Add changeset
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 23, 2025
@cte cte closed this Apr 23, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 23, 2025
@cte cte deleted the cte/debounce-task-folder-size-reads branch April 23, 2025 18:40

let taskDirSize = 0
if (Date.now() - this.taskDirSizeCheckedAt > this.taskDirSizeCheckInterval) {
this.taskDirSizeCheckedAt = Date.now()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting taskDirSizeCheckedAt before the asynchronous folder size call may lead to a stale folder size when the call fails – subsequent calls won’t retry until after the full interval. Consider updating the timestamp only after a successful retrieval so that errors aren’t cached.

This comment was generated because it violated a code review rule: mrule_OR1S8PRRHcvbdFib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.