fix: expose WhatsApp sender ids in group context
This commit is contained in:
@@ -1517,7 +1517,7 @@ describe("group intro prompts", () => {
|
|||||||
vi.mocked(runEmbeddedPiAgent).mock.calls.at(-1)?.[0]
|
vi.mocked(runEmbeddedPiAgent).mock.calls.at(-1)?.[0]
|
||||||
?.extraSystemPrompt ?? "";
|
?.extraSystemPrompt ?? "";
|
||||||
expect(extraSystemPrompt).toBe(
|
expect(extraSystemPrompt).toBe(
|
||||||
`You are replying inside the WhatsApp group "Ops". Activation: trigger-only (you are invoked only when explicitly mentioned; recent context may be included). ${groupParticipationNote} Address the specific sender noted in the message context.`,
|
`You are replying inside the WhatsApp group "Ops". Activation: trigger-only (you are invoked only when explicitly mentioned; recent context may be included). WhatsApp IDs: SenderId is the participant JID; [message_id: ...] is the message id for reactions (use SenderId as participant). ${groupParticipationNote} Address the specific sender noted in the message context.`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -213,6 +213,10 @@ export function buildGroupIntro(params: {
|
|||||||
activation === "always"
|
activation === "always"
|
||||||
? "Activation: always-on (you receive every group message)."
|
? "Activation: always-on (you receive every group message)."
|
||||||
: "Activation: trigger-only (you are invoked only when explicitly mentioned; recent context may be included).";
|
: "Activation: trigger-only (you are invoked only when explicitly mentioned; recent context may be included).";
|
||||||
|
const whatsappIdsLine =
|
||||||
|
provider === "whatsapp"
|
||||||
|
? "WhatsApp IDs: SenderId is the participant JID; [message_id: ...] is the message id for reactions (use SenderId as participant)."
|
||||||
|
: undefined;
|
||||||
const silenceLine =
|
const silenceLine =
|
||||||
activation === "always"
|
activation === "always"
|
||||||
? `If no response is needed, reply with exactly "${params.silentToken}" (and nothing else) so Clawdbot stays silent. Do not add any other words, punctuation, tags, markdown/code blocks, or explanations.`
|
? `If no response is needed, reply with exactly "${params.silentToken}" (and nothing else) so Clawdbot stays silent. Do not add any other words, punctuation, tags, markdown/code blocks, or explanations.`
|
||||||
@@ -227,6 +231,7 @@ export function buildGroupIntro(params: {
|
|||||||
subjectLine,
|
subjectLine,
|
||||||
membersLine,
|
membersLine,
|
||||||
activationLine,
|
activationLine,
|
||||||
|
whatsappIdsLine,
|
||||||
silenceLine,
|
silenceLine,
|
||||||
cautionLine,
|
cautionLine,
|
||||||
lurkLine,
|
lurkLine,
|
||||||
|
|||||||
@@ -1261,6 +1261,7 @@ export async function monitorWebProvider(
|
|||||||
msg.senderE164,
|
msg.senderE164,
|
||||||
),
|
),
|
||||||
SenderName: msg.senderName,
|
SenderName: msg.senderName,
|
||||||
|
SenderId: msg.senderJid ?? msg.senderE164,
|
||||||
SenderE164: msg.senderE164,
|
SenderE164: msg.senderE164,
|
||||||
WasMentioned: msg.wasMentioned,
|
WasMentioned: msg.wasMentioned,
|
||||||
...(msg.location ? toLocationContext(msg.location) : {}),
|
...(msg.location ? toLocationContext(msg.location) : {}),
|
||||||
|
|||||||
Reference in New Issue
Block a user