@ynhcj/xiaoyi-channel 0.0.9-beta → 0.0.10-beta
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/src/reply-dispatcher.js +26 -2
- package/package.json +1 -1
|
@@ -156,14 +156,38 @@ export function createXYReplyDispatcher(params) {
|
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
158
|
log(`[ON_IDLE] Skipping final message: hasSentResponse=${hasSentResponse}, finalSent=${finalSent}`);
|
|
159
|
+
// Task was interrupted - send failure status and error response
|
|
160
|
+
try {
|
|
161
|
+
await sendStatusUpdate({
|
|
162
|
+
config,
|
|
163
|
+
sessionId,
|
|
164
|
+
taskId,
|
|
165
|
+
messageId,
|
|
166
|
+
text: "任务处理中断了~",
|
|
167
|
+
state: "failed",
|
|
168
|
+
});
|
|
169
|
+
log(`[ON_IDLE] ✅ Sent failure status update`);
|
|
170
|
+
await sendA2AResponse({
|
|
171
|
+
config,
|
|
172
|
+
sessionId,
|
|
173
|
+
taskId,
|
|
174
|
+
messageId,
|
|
175
|
+
text: "任务执行异常,请重试~",
|
|
176
|
+
append: false,
|
|
177
|
+
final: true,
|
|
178
|
+
});
|
|
179
|
+
finalSent = true;
|
|
180
|
+
log(`[ON_IDLE] ✅ Sent error response`);
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
error(`[ON_IDLE] Failed to send failure status and error response:`, err);
|
|
184
|
+
}
|
|
159
185
|
}
|
|
160
186
|
// Stop status updates
|
|
161
187
|
stopStatusInterval();
|
|
162
188
|
},
|
|
163
189
|
onCleanup: () => {
|
|
164
190
|
log(`[ON_CLEANUP] Reply cleanup for session ${sessionId}, hasSentResponse=${hasSentResponse}, finalSent=${finalSent}`);
|
|
165
|
-
// Stop status updates
|
|
166
|
-
stopStatusInterval();
|
|
167
191
|
},
|
|
168
192
|
});
|
|
169
193
|
return {
|