Elffuss BraidHub

kikocis/continue public

fix: abort2error during stream fim
Changeset887e1b6f8cf7000e23ecf9caddc687bacb1a847be13fb845ff0156308f6f51ce
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-04 18:52 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-04 18:52 +05:30
Parents889a2b6d9e98

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 }