feat: add agent prefix to self-chat replies for visual distinction

This commit is contained in:
linuztx 2026-03-26 16:05:44 +08:00
parent 18c5716d10
commit e664673c1c
2 changed files with 9 additions and 0 deletions

View file

@ -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)

View file

@ -0,0 +1,2 @@
[🤖 Agent Zero]
{{response_text}}