Elffuss BraidHub

kikocis/continue public

Merge pull request #7578 from uinstinct/abort2error

fix: aborterror2 during stream fim
Changesetadd90d1f38c61abc22e20d97db754b027bb9d5ca7ae7f479ac36095ea9aada46
AuthorTing-Wai <40179554+tingwai@users.noreply.github.com> · 2025-09-05 14:58 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-05 14:58 -07:00
Parentsaf695458de9d, 7e921f486bfb

Browse the files at this changeset

1 file changed

modified core/llm/index.ts +13 −11
@@ -370,8 +370,17 @@
370370 },
371371 });
372372
373- if (error !== undefined) {
374- if (error === "cancel" || error.name === "AbortError") {
373+ if (typeof error === "undefined") {
374+ interaction?.logItem({
375+ kind: "success",
376+ promptTokens,
377+ generatedTokens,
378+ thinkingTokens,
379+ usage,
380+ });
381+ return "success";
382+ } else {
383+ if (error === "cancel" || error?.name?.includes("AbortError")) {
375384 interaction?.logItem({
376385 kind: "cancel",
377386 promptTokens,
@@ -393,15 +402,6 @@
393402 });
394403 return "error";
395404 }
396- } else {
397- interaction?.logItem({
398- kind: "success",
399- promptTokens,
400- generatedTokens,
401- thinkingTokens,
402- usage,
403- });
404- return "success";
405405 }
406406 }
407407
@@ -615,6 +615,7 @@
615615 kind: "chunk",
616616 chunk: formattedContent,
617617 });
618+
618619 completion += formattedContent;
619620 yield content;
620621 }
@@ -630,6 +631,7 @@
630631 kind: "chunk",
631632 chunk,
632633 });
634+
633635 completion += chunk;
634636 yield chunk;
635637 }