fix: preserve content integrity in VS Code LM provider #2427
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.
Context
The VS Code LM provider was modifying system information and model responses by stripping escape sequences and performing other transformations.
The issue was discovered when attempting to use escape sequences like '\x1b' in text, which were being removed by the cleanTerminalOutput method. This caused problems in scenarios where escape sequences needed to be preserved, such as when working with terminal control codes.
Implementation
It is not the responsibility of the provider to modify input/output to and from the model. Roo expects all communication through different providers to be clean so that it can manage transformation centrally.
How to Test
Note: This PR is submitted as a draft because I plan to test it locally to see if there are any unexpected side effects from removing the content cleaning functionality.
Get in Touch
Discord: KJ7LNW
Important
Removes
cleanTerminalOutputfromvscode-lm.tsto preserve escape sequences in VS Code LM provider responses.cleanTerminalOutputmethod fromvscode-lm.ts, which stripped escape sequences and transformed text.cleanMessageContentto return content directly without cleaning.\x1bare preserved in model responses.This description was created by
for 7538e12. It will automatically update as commits are pushed.