expanded logs with catch all

This commit is contained in:
duffyduck 2026-03-13 08:05:26 +01:00
parent 571345ed0d
commit fcb22f60d3
2 changed files with 30 additions and 6 deletions

View File

@ -58,7 +58,7 @@ docker exec aria-core sh -c 'cat > /home/node/.openclaw/openclaw.json << '"'"'IN
}
},
"messages": {
"ackReactionScope": "group-mentions"
"ackReactionScope": "all"
},
"commands": {
"native": "auto",

View File

@ -201,10 +201,12 @@ async function connectGateway() {
gatewayWs = ws;
broadcastState();
// Nachrichten-Loop
// Nachrichten-Loop — RAW logging fuer Debugging
ws.on("message", (raw) => {
try {
const msg = JSON.parse(raw.toString());
const rawStr = raw.toString();
log("debug", "gateway", `RAW <<< ${rawStr.slice(0, 300)}`);
const msg = JSON.parse(rawStr);
handleGatewayMessage(msg);
} catch (err) {
log("error", "gateway", `Parse-Fehler: ${err.message}`);
@ -281,8 +283,28 @@ function handleGatewayMessage(msg) {
return;
}
// Andere Events (presence, tick, etc.)
log("debug", "gateway", `Event: ${event}`);
// Alle anderen Events — vollstaendig loggen fuer Debugging
const payloadStr = JSON.stringify(payload).slice(0, 500);
log("info", "gateway", `Event: ${event} | ${payloadStr}`);
if (pipelineActive) plog(`Gateway Event: ${event} | ${payloadStr.slice(0, 200)}`);
// "chat" Event koennte die Antwort sein (anderes Format als erwartet)
if (event === "chat") {
const text = payload.text || payload.message || payload.content || "";
const delta = payload.delta || "";
const error = payload.error || "";
if (error) {
log("error", "gateway", `Chat-Fehler (event:chat): ${error}`);
if (pipelineActive) pipelineEnd(false, error);
broadcast({ type: "chat_error", error, payload });
} else if (text) {
log("info", "gateway", `ANTWORT (event:chat): "${text.slice(0, 200)}"`);
if (pipelineActive) pipelineEnd(true, `"${text.slice(0, 120)}"`);
broadcast({ type: "chat_final", text, payload });
} else if (delta) {
broadcast({ type: "chat_delta", delta, payload });
}
}
}
}
@ -305,7 +327,9 @@ function sendToGateway(text, isPipeline) {
},
};
gatewayWs.send(JSON.stringify(msg));
const payload = JSON.stringify(msg);
log("debug", "gateway", `RAW >>> ${payload}`);
gatewayWs.send(payload);
log("info", "gateway", `chat.send [${reqId}]: "${text}"`);
if (isPipeline) plog(`chat.send [${reqId}] an Gateway gesendet — warte auf ACK...`);
return true;