claw-subagent-service 0.0.117 → 0.0.119
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
CHANGED
|
@@ -294,14 +294,20 @@ class MessageHandler {
|
|
|
294
294
|
}
|
|
295
295
|
} catch (err) {
|
|
296
296
|
this.log?.error(`[MessageHandler] 流式处理失败,回退到非流式: ${err.message}`);
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
await this.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
this.
|
|
297
|
+
|
|
298
|
+
// 只有非取消错误才回退到非流式处理
|
|
299
|
+
if (err.message !== 'canceled') {
|
|
300
|
+
const reply = await this.handleNormalMessage(msg);
|
|
301
|
+
if (reply) {
|
|
302
|
+
const targetId = this.getReplyTarget(msg);
|
|
303
|
+
await this.sendFn(targetId, reply, msg.conversationType);
|
|
304
|
+
// 非流式回退成功,群聊轮数 +1
|
|
305
|
+
if (msg.conversationType === 3) {
|
|
306
|
+
this._incrementGroupRoundCount(msg.targetId, maxRounds);
|
|
307
|
+
}
|
|
304
308
|
}
|
|
309
|
+
} else {
|
|
310
|
+
this.log?.info(`[MessageHandler] 请求被取消,不回退到非流式处理`);
|
|
305
311
|
}
|
|
306
312
|
}
|
|
307
313
|
} else {
|
|
@@ -472,7 +478,12 @@ class MessageHandler {
|
|
|
472
478
|
typingTimer = null;
|
|
473
479
|
}
|
|
474
480
|
|
|
475
|
-
|
|
481
|
+
// 只有非取消错误才发送错误提示
|
|
482
|
+
if (err.message !== 'canceled') {
|
|
483
|
+
await this._sendStreamChunk(fromUserId, targetId, conversationType, '抱歉,AI 响应出现错误,请稍后重试。', streamId, true, true, 1);
|
|
484
|
+
} else {
|
|
485
|
+
this.log?.info(`[MessageHandler] 请求被取消,不发送错误提示消息`);
|
|
486
|
+
}
|
|
476
487
|
|
|
477
488
|
// 错误时也要清理
|
|
478
489
|
this._streamMessageUIDs.delete(streamId);
|