@capekai/core 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/chat-handler.ts +12 -1
package/package.json
CHANGED
package/src/core/chat-handler.ts
CHANGED
|
@@ -682,10 +682,21 @@ export async function handleChat<Origin>(
|
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
if (result.isFatal
|
|
685
|
+
if (result.isFatal) {
|
|
686
686
|
return;
|
|
687
687
|
}
|
|
688
688
|
|
|
689
|
+
if (result.interrupted) {
|
|
690
|
+
// The old turn has finished cleanup; queued input starts a fresh turn.
|
|
691
|
+
const next = await drainQueue(ctx, sessionId);
|
|
692
|
+
if (!next) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
currentContent = next.content;
|
|
696
|
+
currentAttachments = next.attachments;
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
|
|
689
700
|
if (result.isQueueDrainable) {
|
|
690
701
|
const next = await drainQueue(ctx, sessionId);
|
|
691
702
|
if (next) {
|