claw-subagent-service 0.0.126 → 0.0.127
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
|
@@ -151,8 +151,9 @@ class RongyunMessageHandler {
|
|
|
151
151
|
}, requestId, sourceId);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
//
|
|
155
|
-
|
|
154
|
+
// 执行命令(在后台异步执行,不阻塞响应)
|
|
155
|
+
// 使用 Promise 避免阻塞,让命令在后台执行
|
|
156
|
+
executeCommand(command, null, async (response) => {
|
|
156
157
|
if (!isAsyncCommand) {
|
|
157
158
|
// 同步命令立即响应
|
|
158
159
|
await this.sendResponse(RongyunMessageTypeEnum.COMMAND_RESULT, {
|
|
@@ -161,6 +162,10 @@ class RongyunMessageHandler {
|
|
|
161
162
|
}, requestId, sourceId);
|
|
162
163
|
}
|
|
163
164
|
// 异步命令不在这里响应,因为已经提前响应了
|
|
165
|
+
// 但我们可以在这里记录执行结果
|
|
166
|
+
this.logInfo(`[RongyunMessageHandler] 命令执行完成: command=${command}, status=${response.status}, message=${response.message}`);
|
|
167
|
+
}).catch(err => {
|
|
168
|
+
this.logError(`[RongyunMessageHandler] 命令执行失败: ${err.message}`);
|
|
164
169
|
});
|
|
165
170
|
} catch (e) {
|
|
166
171
|
const msg = e instanceof Error ? e.message : String(e);
|