palz-connector 1.5.7 → 1.5.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "palz-connector",
3
3
  "name": "Palz Connector Channel",
4
- "version": "1.5.7",
4
+ "version": "1.5.8",
5
5
  "description": "Palz IM 接入 OpenClaw",
6
6
  "channels": [
7
7
  "palz-connector"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palz-connector",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "description": "Palz IM 接入 OpenClaw — 模块化架构,基于 OpenClaw Runtime 消息管道",
package/src/monitor.js CHANGED
@@ -6,8 +6,6 @@
6
6
  */
7
7
  import WebSocket from "ws";
8
8
  import { handlePalzMessage } from "./bot.js";
9
- import { sendToPalzIM } from "./send.js";
10
- import { buildPassthroughFromMsg } from "./message-utils.js";
11
9
  import { reportPalzActivity } from "./activity.js";
12
10
  import { tracer, extractTraceparentContext, SpanStatusCode } from "./tracing.js";
13
11
  const WS_CONNECT_TIMEOUT_MS = 15_000;
@@ -220,28 +218,12 @@ export async function monitorPalzProvider(params) {
220
218
  }).catch((err) => {
221
219
  error(`palz[${accountId}]: [ACTIVITY_REPORT] unhandled error: ${err.message ?? err}`);
222
220
  });
223
- // agent_id 必填:从消息中取,缺失时回复 IM 错误并跳过 AI 分发
224
- const messageAgentId = typeof msg.agent_id === "string" ? msg.agent_id.trim() : "";
221
+ // agent_id:从消息中取,缺失/空时默认为 {userId}-main
222
+ let messageAgentId = typeof msg.agent_id === "string" ? msg.agent_id.trim() : "";
225
223
  if (!messageAgentId) {
226
- error(`palz[${accountId}]: missing agent_id, skipping message msg_id=${msg.msg_id}`);
227
- sendToPalzIM({
228
- config,
229
- conversationId: msg.conversation_id,
230
- content: "消息缺少 agent_id,无法路由到 Agent。",
231
- conversationType: msg.conversation_type || "direct",
232
- msgId: msg.msg_id,
233
- senderId: msg.sender_id,
234
- msgType: msg.msg_type,
235
- groupId: msg.conversation_type === "group" ? msg.conversation_id : undefined,
236
- lobsterId: msg.lobster_id,
237
- palzMsgType: "error",
238
- passthrough: buildPassthroughFromMsg(msg),
239
- log,
240
- error,
241
- }).catch((err) => {
242
- error(`palz[${accountId}]: missing agent_id error reply failed: ${err.message ?? err}`);
243
- });
244
- return;
224
+ messageAgentId = `${accountId}-main`;
225
+ msg.agent_id = messageAgentId;
226
+ log(`palz[${accountId}]: agent_id missing, defaulting to "${messageAgentId}" msg_id=${msg.msg_id}`);
245
227
  }
246
228
  handlePalzMessage({
247
229
  cfg,