@spzhongwin/skill-logger-plugin 1.0.6 → 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/ws-client.ts +12 -3
package/package.json
CHANGED
package/src/ws-client.ts
CHANGED
|
@@ -155,6 +155,13 @@ export class GatewayWsClient {
|
|
|
155
155
|
this.appendLogToFile("INFO", "Heartbeat", "Server heartbeat acknowledged", { type: msg.type, connectionId: msg.connectionId });
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
+
if (msg?.type === "BATCH_COMMAND" && Array.isArray(msg.commands)) {
|
|
159
|
+
const { commands, type, ...shared } = msg;
|
|
160
|
+
for (const cmd of commands) {
|
|
161
|
+
await this.handleMessage({ ...shared, userId: cmd.userId, replyId: cmd.replyId });
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
158
165
|
await this.handleMessage(msg);
|
|
159
166
|
} catch (err) {
|
|
160
167
|
console.error(`[skill-logger-plugin][WS] Failed to parse/handle message:`, err);
|
|
@@ -195,9 +202,10 @@ export class GatewayWsClient {
|
|
|
195
202
|
try {
|
|
196
203
|
entries = await fs.readdir(rootPath);
|
|
197
204
|
} catch (e) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
// 读目录失败通常是瞬时性的(磁盘抖动/权限/句柄耗尽等),不代表这台机器真的没有用户了。
|
|
206
|
+
// 跳过本轮上报、保留上次已知状态,等下一次扫描自然重试,避免把瞬时故障放大成
|
|
207
|
+
// "全部用户离线"(服务端收到空列表会把这台网关下所有用户标记 OFFLINE)。
|
|
208
|
+
this.appendLogToFile("WARN", "AgentScan", "OpenClaw home is not readable; skipping this scan cycle", e);
|
|
201
209
|
return;
|
|
202
210
|
}
|
|
203
211
|
|
|
@@ -331,6 +339,7 @@ export class GatewayWsClient {
|
|
|
331
339
|
gatewayId: this.options.gatewayId,
|
|
332
340
|
agentIds: Array.from(this.currentAgentIds),
|
|
333
341
|
clientTime: Date.now(),
|
|
342
|
+
supportsBatch: true,
|
|
334
343
|
}, "Heartbeat");
|
|
335
344
|
}
|
|
336
345
|
|