palz-connector 1.5.3 → 1.5.5
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/bot.js +22 -0
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/bot.js
CHANGED
|
@@ -14,6 +14,7 @@ import { resolvePalzAccount } from "./config.js";
|
|
|
14
14
|
import { tryClaimMessage } from "./dedup.js";
|
|
15
15
|
import { createPalzReplyDispatcher } from "./reply-dispatcher.js";
|
|
16
16
|
import { resolvePalzMediaList, resolveMediaLocalRoots } from "./media.js";
|
|
17
|
+
import { sendToPalzIM } from "./send.js";
|
|
17
18
|
import { tracer, trace, context, SpanStatusCode } from "./tracing.js";
|
|
18
19
|
// ============ 原始消息透传字段 ============
|
|
19
20
|
const PASSTHROUGH_EXCLUDE = new Set(["event", "content", "timestamp"]);
|
|
@@ -371,6 +372,27 @@ async function _dispatchPalzMessageInner(params) {
|
|
|
371
372
|
if (isGroup) {
|
|
372
373
|
log(`${tag}: [group_id] resolved=${groupId ?? "(none)"} conv=${msg.conversation_id}`);
|
|
373
374
|
}
|
|
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
|
+
}
|
|
374
396
|
// peerId 使用 4 段格式,确保 cron delivery 推断 to 时包含完整路由信息(含 lobster_id)
|
|
375
397
|
// 格式: {conversationType}:{senderId}:{lobsterId}:{conversationId}
|
|
376
398
|
// 群聊中不同用户共享 session:senderId 固定为 "_"
|