diff --git a/src/agents/pi-embedded-runner/run.ts b/src/agents/pi-embedded-runner/run.ts index a8cd1799b75..1a116495ffa 100644 --- a/src/agents/pi-embedded-runner/run.ts +++ b/src/agents/pi-embedded-runner/run.ts @@ -1615,7 +1615,6 @@ export async function runEmbeddedPiAgent( payloads.length === 0 && !aborted && !timedOut && - !attempt.didSendViaMessagingTool && !attempt.clientToolCall && !attempt.yieldDetected && !attempt.didSendDeterministicApprovalPrompt && diff --git a/src/auto-reply/reply/agent-runner-execution.ts b/src/auto-reply/reply/agent-runner-execution.ts index 9cfea79a29c..c03ae71f154 100644 --- a/src/auto-reply/reply/agent-runner-execution.ts +++ b/src/auto-reply/reply/agent-runner-execution.ts @@ -708,9 +708,12 @@ export async function runAgentTurnWithFallback(params: { // error payload into runResult so it flows through the normal // kind:"success" path — preserving streaming dedup, message_send // suppression, and usage/model metadata updates. - if (runResult && !runResult.didSendViaMessagingTool) { + if (runResult) { const hasNonErrorContent = runResult.payloads?.some( - (p) => !p.isError && (p.text?.trim() || (p.mediaUrls?.length ?? 0) > 0), + (p) => + !p.isError && + !p.isReasoning && + (p.text?.trim() || (p.mediaUrls?.length ?? 0) > 0), ); if (!hasNonErrorContent) { const metaErrorMsg = finalEmbeddedError?.message ?? "";