From e664673c1ce7c64a8fbb36071ece1484f274764c Mon Sep 17 00:00:00 2001 From: linuztx Date: Thu, 26 Mar 2026 16:05:44 +0800 Subject: [PATCH] feat: add agent prefix to self-chat replies for visual distinction --- plugins/_whatsapp_integration/helpers/handler.py | 7 +++++++ .../prompts/fw.wa.self_chat_prefix.md | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 plugins/_whatsapp_integration/prompts/fw.wa.self_chat_prefix.md 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