-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: Autofix timeout bug #668
Conversation
I think the failing test is not related to my changes but because of an RCE vulnerability detected by Snyk Code. Is anyone already looking at it? |
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.
Thank you Berkay
It looks good to me besides some nitpicks.
Let's pair on it on Monday. I would like to revisit / understand some stuff here, like why do we have the AutofixStatus struct and if we can simplify/refactor it a bit.
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.
Some nitpicks - please decide yourself what to update :). Thanks for the PR, Berkay!
Description
Autofix Diffs flow (web view flow) was implemented slightly differently than the code action flow. The diff flow treated an empty list of suggestions as an error and invalid response. This is not the correct behavior because the AI Fix pipeline might run successfully and there can be no valid fixes found.
The code was polling until the suggestion's length was not 0. This causes the returned successful response with empty suggestions to be ignored and the code aggressively keeps polling until the timeout hits. The timeout takes 2 minutes whereas the result is available after several seconds. The timeout also hides the real issue from the user, making the user think something unexpected happened whereas we could not compute any valid fix.
This PR corrects the flow for autofix diffs by
Checklist
I uploaded a video to my drive showing the incorrect behavior on the IDE.
https://drive.google.com/file/d/1BlHmbkW5WEiSdPQKzmjoU-5IspK20PoZ/vi
and here the corrected behaviour which immediately shows user the result of 0 fixes
ide_no_timeout.mp4