Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 25, 2025

This PR fixes issue #6194 where excessive VSCode file context was causing connection errors with LLMs that have limited context windows.

Changes

  • Added new global setting includeVSCodeFileContext (defaults to true for backward compatibility)
  • Updated getEnvironmentDetails to conditionally include VSCode file context based on the setting
  • Added setting to ExtensionState and webview message handler
  • Added comprehensive tests for the new functionality
  • Updated webview-ui components to include the new property

How it works

When includeVSCodeFileContext is set to false, the VSCode visible files and open tabs sections will not be included in subsequent API calls after the initial request. This significantly reduces the context size for models with limited context windows.

The setting defaults to true to maintain backward compatibility for users who rely on the current behavior.

Fixes #6194


Important

Introduces includeVSCodeFileContext setting to manage VSCode file context inclusion in API calls, with updates to settings, tests, and UI components.

  • Behavior:
    • Adds includeVSCodeFileContext setting to control inclusion of VSCode file context in API calls, defaulting to true.
    • Updates getEnvironmentDetails in getEnvironmentDetails.ts to conditionally include VSCode file context.
    • Modifies webviewMessageHandler in webviewMessageHandler.ts to handle includeVSCodeFileContext messages.
  • Tests:
    • Adds tests in getEnvironmentDetails.spec.ts and ClineProvider.spec.ts to verify behavior when includeVSCodeFileContext is toggled.
  • UI:
    • Updates ExtensionStateContext.tsx and ExtensionStateContext.spec.tsx to manage and test the new setting.

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

roomote added 2 commits July 25, 2025 02:03
…ext in API calls

- Add new global setting includeVSCodeFileContext (defaults to true)
- Update getEnvironmentDetails to conditionally include VSCode file context
- Add setting to ExtensionState and webview message handler
- Add comprehensive tests for the new functionality

This fixes issue #6194 where excessive VSCode file context was causing
connection errors with LLMs that have limited context windows.
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 25, 2025 02:06
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jul 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 25, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

"roo code" reads all repo files when executing commands, resulting in the inability to call the large model.

3 participants