Roo-Code Reverts Manual Code Edits During A Session.
Introduction
Roo-Code, a powerful code editing tool, has been reported to revert manual code edits made by users during a session. This issue has been observed in version 3.8.4 of the app, using OpenRouter as the API provider and Claude 3.5-Sonnet as the model. In this article, we will delve into the details of this issue, explore the steps to reproduce it, and discuss the possible reasons behind this behavior.
The Issue
When editing a long .dart file with layout elements, Roo-Code reverts edits that the user made manually in the code editor during that session. This issue is particularly frustrating when working on complex codebases, where manual edits are a common occurrence. The problem arises when the user makes a manual edit to a line of code, saves the file, and then asks Roo-Code to make an unrelated edit elsewhere in the file. In this scenario, Roo-Code reverts the manual edit, effectively undoing the user's work.
Steps to Reproduce
To reproduce this issue, follow these steps:
- Start an Roo session in "Code" mode: Begin a new Roo session in "Code" mode, which allows for manual editing of code.
- Have Roo make some modifications to a specific file: Ask Roo to make some modifications to a specific file, such as adding a new function or modifying an existing one.
- Make a manual edit to that same file in the code editor: Make a manual edit to the same file in the code editor, such as changing a variable name or adding a new line of code.
- Save the file and don't talk to Roo about it: Save the file and do not inform Roo about the manual edit.
- Ask Roo to make another modification to that specific file: Ask Roo to make another modification to the same file, such as adding a new function or modifying an existing one.
- Roo reverts your manual edits: Roo will revert the manual edits made in step 3, effectively undoing the user's work.
Relevant API Request Output
# No relevant API request output is provided in the original report.
Additional Context
It appears that whenever Roo makes an edit to a file, it is actually rewriting that entire file from its context memory each time. This behavior is not immediately apparent in small files, but it becomes more noticeable in longer files. In "Architect" mode, Roo is capable of identifying the single line of code that needs to be edited within a long script and printing out the edit that the user should make. However, in "Code" mode, Roo rewrites the entire file, effectively deleting and rewriting every line of code.
Possible Reasons Behind This Behavior
There are several possible reasons behind this behavior:
- Roo's caching mechanism: Roo's caching mechanism may be causing it to rewrite the entire file each time an edit is made, rather than just updating the specific line of code that needs to be changed.
- Lack of support for manual edits: Roo may not have built-in support for manual edits, which could be causing it to revert the user's work.
- Inconsistent behavior between modes: The behavior of Roo in "Code" mode may be inconsistent with its behavior in "Architect" mode, which could be causing the issue.
Conclusion
Introduction
In our previous article, we discussed the issue of Roo-Code reverting manual code edits during a session. In this article, we will provide a Q&A section to address some of the most frequently asked questions about this issue.
Q: What is the current version of Roo-Code that is affected by this issue?
A: The current version of Roo-Code that is affected by this issue is 3.8.4.
Q: Which API provider is affected by this issue?
A: The OpenRouter API provider is affected by this issue.
Q: Which model is affected by this issue?
A: The Claude 3.5-Sonnet model is affected by this issue.
Q: What is the exact behavior of Roo-Code when it reverts manual code edits?
A: When Roo-Code reverts manual code edits, it effectively deletes and rewrites the entire file, including the manual edits made by the user.
Q: Can I reproduce this issue in a controlled environment?
A: Yes, you can reproduce this issue in a controlled environment by following the steps outlined in our previous article.
Q: What are the possible reasons behind this behavior?
A: There are several possible reasons behind this behavior, including:
- Roo's caching mechanism
- Lack of support for manual edits
- Inconsistent behavior between modes
Q: How can I work around this issue?
A: There are several ways to work around this issue, including:
- Using alternative editing tools or workflows
- Saving the file manually after making manual edits
- Avoiding manual edits during a Roo-Code session
Q: Is this issue specific to the "Code" mode of Roo-Code?
A: Yes, this issue is specific to the "Code" mode of Roo-Code. In "Architect" mode, Roo-Code is capable of identifying the single line of code that needs to be edited and printing out the edit that the user should make.
Q: Can I report this issue to the Roo-Code developers?
A: Yes, you can report this issue to the Roo-Code developers by submitting a bug report or contacting their support team.
Q: What is the expected resolution time for this issue?
A: The expected resolution time for this issue is not specified, but the Roo-Code developers are working to resolve it as soon as possible.
Conclusion
We hope that this Q&A article has provided you with the information you need to understand the issue of Roo-Code reverting manual code edits during a session. If you have any further questions or concerns, please don't hesitate to contact us.