mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 17:01:22 +00:00
fix: harden isolated cron announce delivery fallback (#15739) (thanks @widingmarcus-cyber)
This commit is contained in:
@@ -103,8 +103,9 @@ export type RunCronAgentTurnResult = {
|
||||
sessionKey?: string;
|
||||
/**
|
||||
* `true` when the isolated run already delivered its output to the target
|
||||
* channel (via outbound payloads or the subagent announce flow). Callers
|
||||
* should skip posting a summary to the main session to avoid duplicate
|
||||
* channel (via outbound payloads, the subagent announce flow, or a matching
|
||||
* messaging-tool send). Callers should skip posting a summary to the main
|
||||
* session to avoid duplicate
|
||||
* messages. See: https://github.com/openclaw/openclaw/issues/15692
|
||||
*/
|
||||
delivered?: boolean;
|
||||
@@ -525,7 +526,9 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
}),
|
||||
);
|
||||
|
||||
let delivered = false;
|
||||
// `true` means we confirmed at least one outbound send reached the target.
|
||||
// Keep this strict so timer fallback can safely decide whether to wake main.
|
||||
let delivered = skipMessagingToolDelivery;
|
||||
if (deliveryRequested && !skipHeartbeatDelivery && !skipMessagingToolDelivery) {
|
||||
if (resolvedDelivery.error) {
|
||||
if (!deliveryBestEffort) {
|
||||
@@ -556,7 +559,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
// for media/channel payloads so structured content is preserved.
|
||||
if (deliveryPayloadHasStructuredContent) {
|
||||
try {
|
||||
await deliverOutboundPayloads({
|
||||
const deliveryResults = await deliverOutboundPayloads({
|
||||
cfg: cfgWithAgentDefaults,
|
||||
channel: resolvedDelivery.channel,
|
||||
to: resolvedDelivery.to,
|
||||
@@ -566,7 +569,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
bestEffort: deliveryBestEffort,
|
||||
deps: createOutboundSendDeps(params.deps),
|
||||
});
|
||||
delivered = true;
|
||||
delivered = deliveryResults.length > 0;
|
||||
} catch (err) {
|
||||
if (!deliveryBestEffort) {
|
||||
return withRunSession({ status: "error", summary, outputText, error: String(err) });
|
||||
|
||||
Reference in New Issue
Block a user