mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
This commit is contained in:
parent
562a007438
commit
fb711a097c
1 changed files with 9 additions and 4 deletions
|
|
@ -1425,10 +1425,15 @@ export class Task extends EventEmitter<ClineEvents> {
|
|||
// cancel task.
|
||||
this.abortTask()
|
||||
|
||||
await abortStream(
|
||||
"streaming_failed",
|
||||
error.message ?? JSON.stringify(serializeError(error), null, 2),
|
||||
)
|
||||
// Check if this was a user-initiated cancellation
|
||||
// If this.abort is true, it means the user clicked cancel, so we should
|
||||
// treat this as "user_cancelled" rather than "streaming_failed"
|
||||
const cancelReason = this.abort ? "user_cancelled" : "streaming_failed"
|
||||
const streamingFailedMessage = this.abort
|
||||
? undefined
|
||||
: (error.message ?? JSON.stringify(serializeError(error), null, 2))
|
||||
|
||||
await abortStream(cancelReason, streamingFailedMessage)
|
||||
|
||||
const history = await provider?.getTaskWithId(this.taskId)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue