fix: unify inbound sender labels

This commit is contained in:
Peter Steinberger
2026-01-17 05:21:02 +00:00
parent 572e04d5fb
commit f7089cde54
20 changed files with 587 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import {
type ResponsePrefixContext,
} from "../../../auto-reply/reply/response-prefix-template.js";
import { resolveTextChunkLimit } from "../../../auto-reply/chunk.js";
import { formatAgentEnvelope } from "../../../auto-reply/envelope.js";
import { formatInboundEnvelope } from "../../../auto-reply/envelope.js";
import {
buildHistoryContextFromEntries,
type HistoryEntry,
@@ -95,11 +95,13 @@ export async function processMessage(params: {
const bodyWithId = entry.messageId
? `${entry.body}\n[message_id: ${entry.messageId}]`
: entry.body;
return formatAgentEnvelope({
return formatInboundEnvelope({
channel: "WhatsApp",
from: conversationId,
timestamp: entry.timestamp,
body: `${entry.sender}: ${bodyWithId}`,
body: bodyWithId,
chatType: "group",
senderLabel: entry.sender,
});
},
});