-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit: Improve response consistency #1892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the document code-action, /edit and /doc commands and everything worked as expected. also tested the Undo and retry code lenses. The Undo code lense worked, but the retry button would remove the code that we want to retry on?
See loom for details: https://www.loom.com/share/13ced7cf376c473cb43b4bb2ccebf4e4?sid=48a31348-97be-4aab-bfc4-cb1593260a0e
Thanks @abeatrix. The issue I think is because we reuse the It's a little tricky to get this right:
It's not related to these changes (I think possibly a bug from the original retry logic), so I'll create a follow up PR for this one. Looking at it now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying. Approved since the located bug is not from this PR.
## Description https://github.com/sourcegraph/cody/assets/9516420/0f6ac95a-621c-42f2-b42c-b3dd395eaaf3 Follow up on: #1892 (comment) We were retrying fixup tasks with the `selectionRange` - this is not suitable as this range may shrink or expand depending on the code that the LLM produces. Instead we should use the `originalRange` - the range that is provided when the fixup task is created. We still need to track the positions of the range, as it could shift due to code being added above. ## Test plan 1. Create fixups 2. Press "retry" 3. Check retry range is correct (code is not unnecessarily deleted, unless caused by the LLM) <!-- Required. See https://docs.sourcegraph.com/dev/background-information/testing_principles. -->
closes #1790
Description
This PR improves edit consistency by:
Test plan
Create fixups: