-
Notifications
You must be signed in to change notification settings - Fork 213
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 double agent messages with rate limit errors #2535
Conversation
d0601ca
to
e85ec03
Compare
e85ec03
to
8107b84
Compare
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.
lgtm!
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.
LGTM 👍🏻 Nice job tracking this down and good to have a test case to reproduce it.
I'm surprised to see this error since we configure Polly to passthrough requests to github.com The fact this only fails in Node v16 indicates something else might be going on... |
this.consumer.close() | ||
} else { | ||
console.error('Typewriter stopped', error) | ||
if (error) { |
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.
if (error) { | |
if (error) { | |
console.error('Typewriter stopped', error) | |
if (this.consumer.error) { | |
this.consumer.error(error) | |
return | |
} | |
} | |
this.consumer.close() |
would this do the same thing?
…th new fixes (#2583) Close #2588 - Reverts #2575 with updated fixes from #2580 that I've confirmed with @Gedochao on call. - Merged main and updated the recording to confirm there are no errors caused by the changes in this branch in all covered tests: ![image](https://github.com/sourcegraph/cody/assets/68532117/e54d893a-0798-48af-a838-061056fbc889) - Also confirmed this change also passed the new rate limit test introduced in #2535 - Fixed upresponsive stop button when error is presented https://github.com/sourcegraph/cody/assets/68532117/6d9263b0-3e9c-419e-939d-20a2ea011824 ## Test Plan - run `pnpm run test:unit` to confirm all the tests are passing
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.
Confirmed the rate limit test is passing when merged with the latest changes in main:
The large chat test will need to be updated accordingly though. Thanks for all your help on this @pkukielka !
@pkukielka close this PR? My understanding is that this has been merged through other PRs |
Fixes sourcegraph/jetbrains#233
Test plan
Automatic tests to cover the issue were added.
Details
Error
Error: Cannot add a bot message after a bot message
was popping out when message was sent to agent with rate limit exhausted. It was caused bySimpleChatPanelProvider
closingtypewriter
, which in turn was callingclose
callback fromsendLLMRequest
inSimpleChatPanelProvider
.Close callback was then dumping remaining content, resulting in adding agent message twice.