palz-connector 1.5.5 → 1.5.6

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.5",
4
+ "version": "1.5.6",
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.5",
3
+ "version": "1.5.6",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "description": "Palz IM 接入 OpenClaw — 模块化架构,基于 OpenClaw Runtime 消息管道",
package/src/bot.js CHANGED
@@ -307,6 +307,28 @@ async function _handlePalzMessageInner(params) {
307
307
  span?.addEvent(`[STEP 2 跳过] 原因=消息已被处理(去重)`);
308
308
  return;
309
309
  }
310
+ // 立即发送确认消息(在入队之前,不受队列阻塞影响)
311
+ const groupId = isGroup ? msg.conversation_id : undefined;
312
+ try {
313
+ log(`${tag}: [ACK] 发送确认消息 conv=${msg.conversation_id} sender=${msg.sender_id}`);
314
+ await sendToPalzIM({
315
+ config: account.config,
316
+ conversationId: msg.conversation_id,
317
+ content: "收到,正在思考中…",
318
+ conversationType: msg.conversation_type || "direct",
319
+ msgId: msg.msg_id,
320
+ senderId: msg.sender_id,
321
+ msgType: msg.msg_type,
322
+ groupId,
323
+ lobsterId: msg.lobster_id,
324
+ palzMsgType: "thinking",
325
+ passthrough: buildPassthroughFromMsg(msg),
326
+ });
327
+ log(`${tag}: [ACK] 确认消息发送成功`);
328
+ }
329
+ catch (err) {
330
+ log(`${tag}: [ACK] 确认消息发送失败(不影响主流程): ${String(err)}`);
331
+ }
310
332
  // 入队(按 agentId 隔离,不同 agent 并行处理)
311
333
  const queueKey = isGroup
312
334
  ? `${effectiveAgentId}:${msg.conversation_id}`
@@ -372,27 +394,6 @@ async function _dispatchPalzMessageInner(params) {
372
394
  if (isGroup) {
373
395
  log(`${tag}: [group_id] resolved=${groupId ?? "(none)"} conv=${msg.conversation_id}`);
374
396
  }
375
- // 立即发送确认消息,让用户知道 agent 已收到并开始处理
376
- try {
377
- log(`${tag}: [ACK] 发送确认消息 conv=${msg.conversation_id} sender=${msg.sender_id}`);
378
- await sendToPalzIM({
379
- config,
380
- conversationId: msg.conversation_id,
381
- content: "收到,正在思考中…",
382
- conversationType: msg.conversation_type || "direct",
383
- msgId: msg.msg_id,
384
- senderId: msg.sender_id,
385
- msgType: msg.msg_type,
386
- groupId,
387
- lobsterId: msg.lobster_id,
388
- palzMsgType: "thinking",
389
- passthrough: buildPassthroughFromMsg(msg),
390
- });
391
- log(`${tag}: [ACK] 确认消息发送成功`);
392
- }
393
- catch (err) {
394
- log(`${tag}: [ACK] 确认消息发送失败(不影响主流程): ${String(err)}`);
395
- }
396
397
  // peerId 使用 4 段格式,确保 cron delivery 推断 to 时包含完整路由信息(含 lobster_id)
397
398
  // 格式: {conversationType}:{senderId}:{lobsterId}:{conversationId}
398
399
  // 群聊中不同用户共享 session:senderId 固定为 "_"