@xiaozhi-pro/openclaw-plugin 1.0.7 → 1.0.9
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/dist/src/channel.js +4 -0
- package/dist/src/ws-client.js +4 -1
- package/package.json +1 -1
package/dist/src/channel.js
CHANGED
|
@@ -149,6 +149,10 @@ async function dispatchXiaozhiProInboundEvent(params) {
|
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
const rt = getXiaozhiProRuntime();
|
|
152
|
+
if (!rt.channel?.inbound?.run || !rt.channel?.routing?.resolveAgentRoute) {
|
|
153
|
+
console.error("[xiaozhi-pro] 运行时未就绪,丢弃消息。请确认插件已正确注册并重启服务。");
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
152
156
|
const currentCfg = rt.config.current();
|
|
153
157
|
// 1. 解析路由(哪个 agent 处理这个对话)
|
|
154
158
|
const route = rt.channel.routing.resolveAgentRoute({
|
package/dist/src/ws-client.js
CHANGED
|
@@ -10,7 +10,7 @@ export function connectXiaozhiProWs(config) {
|
|
|
10
10
|
let reconnectTimer = null;
|
|
11
11
|
let reconnectAttempts = 0;
|
|
12
12
|
let authFatal = false;
|
|
13
|
-
const MAX_RECONNECT_DELAY =
|
|
13
|
+
const MAX_RECONNECT_DELAY = 60_000;
|
|
14
14
|
function connect() {
|
|
15
15
|
if (abortSignal.aborted || authFatal)
|
|
16
16
|
return;
|
|
@@ -48,6 +48,9 @@ export function connectXiaozhiProWs(config) {
|
|
|
48
48
|
}
|
|
49
49
|
// 服务端推送的入站消息
|
|
50
50
|
if (data.type === "message" || data.type === "response") {
|
|
51
|
+
const text = data.text ?? "";
|
|
52
|
+
const senderId = data.sender_id ?? data.user_id ?? "";
|
|
53
|
+
log?.info?.(`[xiaozhi-pro] 收到消息: type=${data.type}, sender=${senderId}, text=${text.slice(0, 200)}`);
|
|
51
54
|
// 入站消息,分发给 agent
|
|
52
55
|
onMessage({
|
|
53
56
|
type: "message",
|