-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Crash for copilot code block #60118
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
Comments
This doesn't repro for me on VS Code 1.94, with Typescript built from main and Copilot Chat 0.21.2 with GPT 4o as the model. However, the first response "matched public code so it was blocked". The second response succeeded and didn't crash. o1-preview blocked both a first and second response, but not before streaming considerable amounts of code, also without crashing.
|
Looking at the code, it can definitely crash if the children array of the LineNode is empty, which it is upon construction. The crashing line is |
@sandersn I can't reproduce this consistently. I suspect that during streaming of responses, the document ends up in some weird incomplete state that causes this. However even asking the same question again may not trigger this depending on how the code block is streamed to TS |
Fix a crash in an unbacked buffer that copilot is writing to. LineNode.walk reads the first element out of LineNode.children without checking that there are any elements to read. Of course, it's supposed to be called only on nodes that have children. Why no tests? ------------- - This failure is flaky -- I never managed to reproduce it. - scriptVersionCache is barely maintained. The last two fixes in this particular code are 3.5 and 6.5 years ago. - #21924 has no tests to fix an assert - af47ddbc3b0c6421c38b18e56f8da88434a473c8d has an exasperated comment about the difficulty of learning invariants and an apology for an only-possibly-relevant test. - So, I didn't think the effort of a complete fix was worthwhile in a case where a small, local fix will stop the crashes.
π Search Terms
π Version & Regression Information
5.7.0-dev.20240927, not a regression
β― Playground Link
No response
π» Code
Using copilot in VS Code:
@workspace /tests The last work call has a delay of 51 ms, but I already waited out the throttle delay why is this and how do I fix it.
π Actual behavior
As the result is streaming back, we get a crash:
The crash seems to happen during response streaming. During this, code blocks may be updated multiple times and the code in them may not be complete
π Expected behavior
No crash
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: