@ynhcj/xiaoyi 2.2.7 → 2.2.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/dist/channel.js +21 -2
- package/package.json +1 -1
package/dist/channel.js
CHANGED
|
@@ -381,6 +381,18 @@ exports.xiaoyiPlugin = {
|
|
|
381
381
|
console.log("=".repeat(60) + "\n");
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
+
// ==================== CHECK EMPTY RESPONSE ====================
|
|
385
|
+
// If response is empty, don't clear timeout (let it trigger)
|
|
386
|
+
if (!completeText || completeText.length === 0) {
|
|
387
|
+
console.log("\n" + "=".repeat(60));
|
|
388
|
+
console.log(`[TIMEOUT] Empty response detected`);
|
|
389
|
+
console.log(` Session: ${message.sessionId}`);
|
|
390
|
+
console.log(` Elapsed: ${elapsed}ms`);
|
|
391
|
+
console.log(` Action: KEEPING TIMEOUT (session conflict detected)`);
|
|
392
|
+
console.log("=".repeat(60) + "\n");
|
|
393
|
+
// Don't send anything, and don't clear timeout
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
384
396
|
console.log("\n" + "-".repeat(60));
|
|
385
397
|
console.log(`XiaoYi: [DELIVER] AI response received`);
|
|
386
398
|
console.log(` Elapsed: ${elapsed}ms`);
|
|
@@ -421,9 +433,16 @@ exports.xiaoyiPlugin = {
|
|
|
421
433
|
console.log(`XiaoYi: [IDLE] Processing complete`);
|
|
422
434
|
console.log(` Total time: ${elapsed}ms`);
|
|
423
435
|
console.log(` Final length: ${accumulatedText.length} chars`);
|
|
436
|
+
// Only clear timeout if we have a valid response
|
|
437
|
+
// If empty, keep timeout running to handle session conflict
|
|
438
|
+
if (accumulatedText.length > 0) {
|
|
439
|
+
runtime.markSessionCompleted(message.sessionId);
|
|
440
|
+
console.log(`[TIMEOUT] Timeout cleared (valid response)\n`);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
console.log(`[TIMEOUT] Keeping timeout (no valid response)\n`);
|
|
444
|
+
}
|
|
424
445
|
console.log("=".repeat(60) + "\n");
|
|
425
|
-
// Clear timeout on completion
|
|
426
|
-
runtime.markSessionCompleted(message.sessionId);
|
|
427
446
|
},
|
|
428
447
|
},
|
|
429
448
|
replyOptions: undefined,
|