fix: add includeVSCodeFileContext setting to control VSCode file context in API calls #6195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #6194 where excessive VSCode file context was causing connection errors with LLMs that have limited context windows.
Changes
includeVSCodeFileContext(defaults to true for backward compatibility)getEnvironmentDetailsto conditionally include VSCode file context based on the settingHow it works
When
includeVSCodeFileContextis 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
includeVSCodeFileContextsetting to manage VSCode file context inclusion in API calls, with updates to settings, tests, and UI components.includeVSCodeFileContextsetting to control inclusion of VSCode file context in API calls, defaulting to true.getEnvironmentDetailsingetEnvironmentDetails.tsto conditionally include VSCode file context.webviewMessageHandlerinwebviewMessageHandler.tsto handleincludeVSCodeFileContextmessages.getEnvironmentDetails.spec.tsandClineProvider.spec.tsto verify behavior whenincludeVSCodeFileContextis toggled.ExtensionStateContext.tsxandExtensionStateContext.spec.tsxto manage and test the new setting.This description was created by
for 3bba874. You can customize this summary. It will automatically update as commits are pushed.