-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Throttle calls to calculate task folder size #2860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 2028dc7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
| try { | ||
| this.taskDirSize = await getFolderSize.loose(taskDir) | ||
| this.taskDirSizeCheckedAt = Date.now() | ||
| } catch (err) { |
There was a problem hiding this comment.
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.
mrubens
left a comment
There was a problem hiding this 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!
* 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]>
* 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>
* Format large numbers * Add changeset
* Package material icons in vsix * Add changeset
|
|
||
| let taskDirSize = 0 | ||
| if (Date.now() - this.taskDirSizeCheckedAt > this.taskDirSizeCheckInterval) { | ||
| this.taskDirSizeCheckedAt = Date.now() |
There was a problem hiding this comment.
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.
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
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.
Clineclass inCline.tsto reduce performance overhead.injectEnv()function inconfig.tsto replace environment variables in strings and objects.Mentioncomponent inMention.tsxfor handling text mentions.TaskActionscomponent inTaskActions.tsxfor task export and deletion.ContextWindowProgresscomponent inContextWindowProgress.tsxfor visualizing token usage.TaskHeader.tsxto use new components and improve task display.ModelPicker.tsxandApiOptions.tsxfor better model selection and configuration.injectEnv()inconfig.test.tsto ensure correct environment variable replacement.validate.tsto include new validation logic for API configurations.This description was created by
for 2028dc7. You can customize this summary. It will automatically update as commits are pushed.