diff --git a/plugins/_whatsapp_integration/helpers/handler.py b/plugins/_whatsapp_integration/helpers/handler.py index 7b109ba0b..b7a9e49cf 100644 --- a/plugins/_whatsapp_integration/helpers/handler.py +++ b/plugins/_whatsapp_integration/helpers/handler.py @@ -237,6 +237,13 @@ async def send_wa_reply( if not reply_to and context.data.get(CTX_WA_IS_GROUP): reply_to = context.data.get(CTX_WA_LAST_MSG_ID, "") + # Prefix response in self-chat mode so user can distinguish agent messages + mode = config.get("mode", "dedicated") + if mode == "self-chat": + response_text = context.agent0.read_prompt( + "fw.wa.self_chat_prefix.md", response_text=response_text, + ) + # Send text try: result = await wa_client.send_message(base_url, chat_id, response_text, reply_to=reply_to) diff --git a/plugins/_whatsapp_integration/prompts/fw.wa.self_chat_prefix.md b/plugins/_whatsapp_integration/prompts/fw.wa.self_chat_prefix.md new file mode 100644 index 000000000..7a0cb9806 --- /dev/null +++ b/plugins/_whatsapp_integration/prompts/fw.wa.self_chat_prefix.md @@ -0,0 +1,2 @@ +[🤖 Agent Zero] +{{response_text}} \ No newline at end of file