-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fixes #4903: Consistent cancellation error messages for thinking vs streaming phases #4904
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
base: main
Are you sure you want to change the base?
Conversation
…treaming phases - Modified Task.ts to check if cancellation was user-initiated (this.abort = true) - When user cancels during thinking phase, now shows 'API Request Cancelled' instead of 'API Streaming Failed' - Ensures consistent UX for user-initiated cancellations regardless of when they occur
Generated with ❤️ by ellipsis.dev |
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 your contribution. I've left a couple of comments on the PR:
- An unnecessary log file seems to have been included in the commit.
- A question about test coverage for the cancellation logic change.
Please take a look when you have a moment.
? undefined | ||
: (error.message ?? JSON.stringify(serializeError(error), null, 2)) | ||
|
||
await abortStream(cancelReason, streamingFailedMessage) |
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.
This change seems to correctly handle the inconsistent cancellation message. I'm curious if there are any existing tests that cover this scenario, or if we could add a new one to ensure this behavior is protected against regressions?
Summary
This PR fixes the inconsistent cancellation error messages reported in issue #4903. Previously, when users cancelled during the thinking phase of reasoning models (like Claude 4.0 Sonnet), they would see a misleading red 'API Streaming Failed' error instead of the expected grey 'API Request Cancelled' message.
Changes Made
Testing
Related Issues
Fixes #4903
Related to #4039
Type of Change