Skip to content

Conversation

@KJ7LNW
Copy link
Contributor

@KJ7LNW KJ7LNW commented Apr 9, 2025

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

  • Removed the cleanTerminalOutput method that was stripping escape sequences
  • Modified the code to use the system prompt directly without any cleaning or transformation

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

  1. Use the VS Code LM provider
  2. Ask the model to reply with '\x1b'
  3. Prior to this patch, it would respond with an empty string ''
  4. After this patch, it will successfully respond with '\x1b'

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 cleanTerminalOutput from vscode-lm.ts to preserve escape sequences in VS Code LM provider responses.

  • Behavior:
    • Removed cleanTerminalOutput method from vscode-lm.ts, which stripped escape sequences and transformed text.
    • Updated cleanMessageContent to return content directly without cleaning.
  • Testing:
    • Ensures that escape sequences like \x1b are preserved in model responses.
    • Prior to this change, such sequences were removed, resulting in empty responses.

This description was created by Ellipsis for 7538e12. It will automatically update as commits are pushed.

Eric Wheeler added 2 commits April 8, 2025 20:40
Translated all Russian comments in the cleanTerminalOutput method to their English equivalents while preserving the code's functionality. This improves code readability for English-speaking developers.

Signed-off-by: Eric Wheeler <[email protected]>
The 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.

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.

Signed-off-by: Eric Wheeler <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Apr 9, 2025

⚠️ No Changeset found

Latest commit: 7538e12

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 10, 2025
@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 10, 2025

I have been using this just fine without problems today, I releasing it for merge

@KJ7LNW KJ7LNW marked this pull request as ready for review April 10, 2025 21:48
@KJ7LNW KJ7LNW requested review from cte and mrubens as code owners April 10, 2025 21:48
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Apr 10, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 11, 2025
@mrubens mrubens merged commit 9c3c935 into RooCodeInc:main Apr 11, 2025
31 checks passed
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Apr 11, 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 lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants