






















@@ -145,17 +145,22 @@ function buildAgentFollowupArgs(params: {
145145resultText: string;
146146deliveryTarget: ExternalBestEffortDeliveryTarget;
147147sessionOnlyOriginChannel?: string;
148+turnSourceChannel?: string;
148149turnSourceTo?: string;
149150turnSourceAccountId?: string;
150151turnSourceThreadId?: string | number;
151152}) {
152153const { deliveryTarget, sessionOnlyOriginChannel } = params;
154+// When the followup run has no deliverable route and no gateway-internal channel,
155+// preserve the raw turnSourceChannel so the spawned agent inherits messageProvider.
156+// Without this, tools.elevated.allowFrom.<provider> checks fail with provider=null.
157+const fallbackChannel = sessionOnlyOriginChannel ?? params.turnSourceChannel;
153158return {
154159sessionKey: params.sessionKey,
155160message: buildExecApprovalFollowupPrompt(params.resultText),
156161deliver: deliveryTarget.deliver,
157162 ...(deliveryTarget.deliver ? { bestEffortDeliver: true as const } : {}),
158-channel: deliveryTarget.deliver ? deliveryTarget.channel : sessionOnlyOriginChannel,
163+channel: deliveryTarget.deliver ? deliveryTarget.channel : fallbackChannel,
159164to: deliveryTarget.deliver
160165 ? deliveryTarget.to
161166 : sessionOnlyOriginChannel
@@ -241,6 +246,7 @@ export async function sendExecApprovalFollowup(
241246 resultText,
242247 deliveryTarget,
243248 sessionOnlyOriginChannel,
249+turnSourceChannel: params.turnSourceChannel,
244250turnSourceTo: params.turnSourceTo,
245251turnSourceAccountId: params.turnSourceAccountId,
246252turnSourceThreadId: params.turnSourceThreadId,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。