fix(agents): drop messaging-tool metadata from sensitive-stop return

Remove didSendViaMessagingTool, messagingToolSentTexts,
messagingToolSentMediaUrls, messagingToolSentTargets, and
successfulCronAdds from the sensitive stop_reason return path.

Propagating these fields causes the safety-filter refusal payload to be
suppressed when a messaging tool has already sent to the same target,
leaving the user with no safety explanation. This aligns the sensitive
error path with other early-return error branches (role_ordering,
image_size) that also omit messaging-tool metadata.
This commit is contained in:
MoerAI 2026-03-20 10:34:44 +09:00
parent ff954a711b
commit c621974a9b

View File

@ -1348,11 +1348,6 @@ export async function runEmbeddedPiAgent(
systemPromptReport: attempt.systemPromptReport,
error: { kind: "sensitive", message: errorText },
},
didSendViaMessagingTool: attempt.didSendViaMessagingTool,
messagingToolSentTexts: attempt.messagingToolSentTexts,
messagingToolSentMediaUrls: attempt.messagingToolSentMediaUrls,
messagingToolSentTargets: attempt.messagingToolSentTargets,
successfulCronAdds: attempt.successfulCronAdds,
};
}
// Handle role ordering errors with a user-friendly message