From 49e3139e7fefff98635a441d2dcb259363cd3af4 Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Fri, 20 Mar 2026 14:06:52 -0700 Subject: [PATCH] fix(agents): pass replay transcript policy Regeneration-Prompt: | After fixing the replay sanitizer helper itself, a follow-up review comment pointed out that runEmbeddedAttempt was still installing wrapStreamFnSanitizeMalformedToolCalls without the active transcriptPolicy. That meant the new Anthropic and Gemini replay recovery paths only ran in direct helper tests, not in the live embedded runner. Update the stream wrapper installation site to pass transcriptPolicy through unchanged so the already-tested replay cleanup, pairing repair, and turn revalidation logic actually executes in production replays. Keep the change scoped to the call site and verify the replay sanitizer test file still passes after the edit. --- src/agents/pi-embedded-runner/run/attempt.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index fce8565fb5e..4911803b4f6 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -2334,6 +2334,7 @@ export async function runEmbeddedAttempt( activeSession.agent.streamFn = wrapStreamFnSanitizeMalformedToolCalls( activeSession.agent.streamFn, allowedToolNames, + transcriptPolicy, ); activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames( activeSession.agent.streamFn,