fix: add toggle for single-file read mode to address model confusion (#8848) #8851
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.
Summary
This PR addresses Issue #8848 by adding a user-configurable toggle to force single-file read mode for AI models that get confused by the multi-file
<args>XML syntax.Problem
Certain AI models (like Qwen3-Coder) incorrectly apply the multi-file
<args><file><path>...</path></file>...</args>syntax from theread_filetool to other tools likewrite_to_file, causing "required parameter path not provided" errors.Solution
useSingleFileReadModeboolean setting to the global settings schemashouldUseSingleFileReadfunction to respect user preferencesChanges
useSingleFileReadModeto schemaTesting
Backward Compatibility
This change is fully backward compatible:
Fixes #8848
Important
Adds a toggle for single-file read mode to address AI model confusion with multi-file syntax, including UI, state management, and tests.
useSingleFileReadModeboolean setting to global settings schema inglobal-settings.ts.shouldUseSingleFileReadfunction insingle-file-read-models.tsto respect user setting.ContextManagementSettings.tsxfor user configuration.ExtensionStateContext.tsxto includeuseSingleFileReadModein state and provide setter.webviewMessageHandler.tsfor state updates.shouldUseSingleFileReadinsingle-file-read-models.test.ts.ExtensionStateContext.spec.tsxto test state management of new setting.This description was created by
for 5e8a771. You can customize this summary. It will automatically update as commits are pushed.