From 64e28a6ac94987a1c89a2e380ce34a9cc826d14f Mon Sep 17 00:00:00 2001 From: Ayaan Zaidi Date: Sun, 3 May 2026 22:21:14 +0530 Subject: [PATCH] fix(reply-context): label current reply target --- src/agents/pi-embedded-runner/run/runtime-context-prompt.ts | 2 +- src/auto-reply/reply/inbound-meta.ts | 2 +- src/auto-reply/reply/strip-inbound-meta.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agents/pi-embedded-runner/run/runtime-context-prompt.ts b/src/agents/pi-embedded-runner/run/runtime-context-prompt.ts index 6009d0e278c..ed30f5d3229 100644 --- a/src/agents/pi-embedded-runner/run/runtime-context-prompt.ts +++ b/src/agents/pi-embedded-runner/run/runtime-context-prompt.ts @@ -62,7 +62,7 @@ export function buildCurrentTurnPromptContextSuffix( }; return [ "", - "Replied message (untrusted, for context):", + "Reply target of current user message (untrusted, for context):", "```json", JSON.stringify(payload, null, 2), "```", diff --git a/src/auto-reply/reply/inbound-meta.ts b/src/auto-reply/reply/inbound-meta.ts index 24fad25d983..20e46398785 100644 --- a/src/auto-reply/reply/inbound-meta.ts +++ b/src/auto-reply/reply/inbound-meta.ts @@ -269,7 +269,7 @@ export function buildInboundUserContextPrefix( const replyToBody = sanitizePromptBody(ctx.ReplyToBody); if (replyToBody) { blocks.push( - formatUntrustedJsonBlock("Replied message (untrusted, for context):", { + formatUntrustedJsonBlock("Reply target of current user message (untrusted, for context):", { sender_label: normalizePromptMetadataString(ctx.ReplyToSender), is_quote: ctx.ReplyToIsQuote === true ? true : undefined, body: replyToBody, diff --git a/src/auto-reply/reply/strip-inbound-meta.ts b/src/auto-reply/reply/strip-inbound-meta.ts index e4db1246c57..f5f02da5408 100644 --- a/src/auto-reply/reply/strip-inbound-meta.ts +++ b/src/auto-reply/reply/strip-inbound-meta.ts @@ -22,7 +22,7 @@ const INBOUND_META_SENTINELS = [ "Conversation info (untrusted metadata):", "Sender (untrusted metadata):", "Thread starter (untrusted, for context):", - "Replied message (untrusted, for context):", + "Reply target of current user message (untrusted, for context):", "Forwarded message context (untrusted metadata):", "Chat history since last reply (untrusted, for context):", ] as const;