Fix empty result JSON dump and missing heartbeat prefix
Bug fixes: - Empty result field handling: Changed truthy check to explicit type check (`typeof parsed?.text === "string"`) in command-reply.ts. Previously, Claude CLI returning `result: ""` would cause raw JSON to be sent to WhatsApp. - Response prefix on heartbeat: Apply `responsePrefix` to heartbeat alert messages in runReplyHeartbeat, matching behavior of regular message handler.
This commit is contained in:
@@ -862,9 +862,16 @@ export async function monitorWebProvider(
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply response prefix if configured (same as regular messages)
|
||||
let finalText = stripped.text;
|
||||
const responsePrefix = cfg.inbound?.responsePrefix;
|
||||
if (responsePrefix && finalText && !finalText.startsWith(responsePrefix)) {
|
||||
finalText = `${responsePrefix} ${finalText}`;
|
||||
}
|
||||
|
||||
const cleanedReply: ReplyPayload = {
|
||||
...replyResult,
|
||||
text: stripped.text,
|
||||
text: finalText,
|
||||
};
|
||||
|
||||
await deliverWebReply({
|
||||
|
||||
Reference in New Issue
Block a user