From 28519263145af96f67ee69dce5a33d6a26ab410d Mon Sep 17 00:00:00 2001 From: Anandesh Sharma <30695364+Anandesh-Sharma@users.noreply.github.com> Date: Sat, 28 Feb 2026 22:38:37 +0530 Subject: [PATCH] fix(cron): condition requireExplicitMessageTarget on resolved delivery (#28017) When a cron job's delivery target resolution fails (resolvedDelivery.ok is false), the agent was still started with requireExplicitMessageTarget: true. This caused "Action send requires a target" errors because the agent's message tool demanded a target that was never resolved. Condition the flag on both deliveryRequested AND resolvedDelivery.ok so the agent can still use messaging tools freely when no valid delivery target exists. Fixes #27898 Co-authored-by: Claude Opus 4.6 --- src/cron/isolated-agent/run.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cron/isolated-agent/run.ts b/src/cron/isolated-agent/run.ts index 0e0582a5283..f9875e1212a 100644 --- a/src/cron/isolated-agent/run.ts +++ b/src/cron/isolated-agent/run.ts @@ -466,7 +466,10 @@ export async function runCronIsolatedAgentTurn(params: { verboseLevel: resolvedVerboseLevel, timeoutMs, runId: cronSession.sessionEntry.sessionId, - requireExplicitMessageTarget: true, + // Only enforce an explicit message target when the cron delivery target + // was successfully resolved. When resolution fails the agent should not + // be blocked by a target it cannot satisfy (#27898). + requireExplicitMessageTarget: deliveryRequested && resolvedDelivery.ok, disableMessageTool: deliveryRequested, abortSignal, });