Fix sendToChannel to use explicit OpenClaw SDK function mapping

Replace dynamic function name construction with CHANNEL_SEND_MAP that
matches the actual PluginRuntime.channel structure. Fixes WhatsApp
(sendMessageWhatsApp) and iMessage (sendMessageIMessage) casing, and
adds WhatsApp's required verbose option. Also adds null guard on SSE
observation payload before type casting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-02-09 20:14:41 -05:00
parent 121f673328
commit 11532a36fb
2 changed files with 30 additions and 8 deletions
+1 -1
View File
@@ -943,7 +943,7 @@ describe("SSE stream integration", () => {
await new Promise((resolve) => setTimeout(resolve, 200));
assert.equal(sentMessages.length, 0);
assert.ok(logs.some((l) => l.includes("Unknown channel type: matrix")));
assert.ok(logs.some((l) => l.includes("Unsupported channel type: matrix")));
await getService().stop({});
});