Skip to content
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 an unnecessary cancel/re-request with GitHub Copilot requests (and fix some other bugs with Copilot exception handling) #12988

Merged

Conversation

sean-mcmanus
Copy link
Contributor

@sean-mcmanus sean-mcmanus commented Nov 22, 2024

Follow up to #12773 and #12979 .

Fixes a GeneralError from a getProjectContext request returning undefined instead of throwing an exception (which triggers the retry).

Fixes this exception being thrown: image
and
image

@sean-mcmanus sean-mcmanus requested review from benmcmorran and a team November 22, 2024 03:01
@sean-mcmanus sean-mcmanus requested a review from a team as a code owner November 22, 2024 03:01
benmcmorran
benmcmorran previously approved these changes Nov 22, 2024
Copy link
Member

@benmcmorran benmcmorran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are safe, although the semantics are a bit confusing.

If cancellation is requested, that's typically an indication that the caller no longer cares about the result, so the old code was making that pattern explicit. However, it's possible that Copilot is behaving in an unexpected way here by requesting cancellation but still populating an internal cache with results that come later.

@sean-mcmanus
Copy link
Contributor Author

I was going to look at additional changes on Monday to remove some of the additional unnecessary cancelling -- and I think I'm going to create a separate function specifically for the register callback, since that appears to be a special case in regards to cancelling.

@sean-mcmanus sean-mcmanus marked this pull request as draft November 23, 2024 19:49
@sean-mcmanus sean-mcmanus marked this pull request as ready for review December 3, 2024 15:41
@sean-mcmanus sean-mcmanus requested a review from lukka December 3, 2024 15:42
lukka
lukka previously approved these changes Dec 3, 2024
@sean-mcmanus sean-mcmanus changed the title Fix an unnecessary cancel/re-request with GitHub Copilot requests. Fix an unnecessary cancel/re-request with GitHub Copilot requests (and fix some other bugs with Copilot exception handling) Dec 4, 2024
Copy link
Contributor

@Colengms Colengms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@sean-mcmanus sean-mcmanus merged commit 052bcff into main Dec 4, 2024
6 checks passed
@sean-mcmanus sean-mcmanus deleted the seanmcm/avoidUnnecessaryCancelRetryWithGitHubCopilot branch December 4, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants