mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:58:27 +00:00
gateway: return actionable error for send channel webchat (openclaw#15703) thanks @rodrigouroz
Verified: - pnpm build - pnpm check (fails on current main with unrelated type errors in src/memory/embedding-manager.test-harness.ts) - pnpm test:macmini (not run after pnpm check failure) - pnpm test -- src/gateway/server-methods/send.test.ts Co-authored-by: rodrigouroz <165576107+rodrigouroz@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -106,6 +106,18 @@ export const sendHandlers: GatewayRequestHandlers = {
|
||||
const channelInput = typeof request.channel === "string" ? request.channel : undefined;
|
||||
const normalizedChannel = channelInput ? normalizeChannelId(channelInput) : null;
|
||||
if (channelInput && !normalizedChannel) {
|
||||
const normalizedInput = channelInput.trim().toLowerCase();
|
||||
if (normalizedInput === "webchat") {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
errorShape(
|
||||
ErrorCodes.INVALID_REQUEST,
|
||||
"unsupported channel: webchat (internal-only). Use `chat.send` for WebChat UI messages or choose a deliverable channel.",
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
|
||||
Reference in New Issue
Block a user