refactor: centralize group sender identity

This commit is contained in:
Peter Steinberger
2026-01-17 03:31:57 +00:00
parent 204309dd3c
commit 3af391eec7
21 changed files with 236 additions and 222 deletions

View File

@@ -22,12 +22,8 @@ export function buildInboundLine(params: {
hasAllowFrom: (cfg.channels?.whatsapp?.allowFrom?.length ?? 0) > 0,
});
const prefixStr = messagePrefix ? `${messagePrefix} ` : "";
const senderLabel =
msg.chatType === "group" ? `${msg.senderName ?? msg.senderE164 ?? "Someone"}: ` : "";
const replyContext = formatReplyContext(msg);
const baseLine = `${prefixStr}${senderLabel}${msg.body}${
replyContext ? `\n\n${replyContext}` : ""
}`;
const baseLine = `${prefixStr}${msg.body}${replyContext ? `\n\n${replyContext}` : ""}`;
// Wrap with standardized envelope for the agent.
return formatAgentEnvelope({