mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 07:34:58 +00:00
fix: set delivered:false and error on announce delivery failure paths
This commit is contained in:
@@ -288,8 +288,9 @@ describe("runCronIsolatedAgentTurn", () => {
|
||||
// Announce delivery failure should not mark a successful agent execution
|
||||
// as error. The execution succeeded; only delivery failed.
|
||||
expect(res.status).toBe("ok");
|
||||
expect(res.delivered).not.toBe(true);
|
||||
expect(res.delivered).toBe(false);
|
||||
expect(res.deliveryAttempted).toBe(true);
|
||||
expect(res.error).toBe("cron announce delivery failed");
|
||||
expect(deps.sendMessageTelegram).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -345,8 +346,9 @@ describe("runCronIsolatedAgentTurn", () => {
|
||||
// Even when announce throws (e.g. "pairing required"), the agent
|
||||
// execution succeeded so the job status should be ok.
|
||||
expect(res.status).toBe("ok");
|
||||
expect(res.delivered).not.toBe(true);
|
||||
expect(res.delivered).toBe(false);
|
||||
expect(res.deliveryAttempted).toBe(true);
|
||||
expect(res.error).toContain("pairing required");
|
||||
expect(deps.sendMessageTelegram).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -337,6 +337,8 @@ export async function dispatchCronDelivery(
|
||||
status: "ok",
|
||||
summary,
|
||||
outputText,
|
||||
error: message,
|
||||
delivered: false,
|
||||
deliveryAttempted,
|
||||
...params.telemetry,
|
||||
});
|
||||
@@ -351,6 +353,8 @@ export async function dispatchCronDelivery(
|
||||
status: "ok",
|
||||
summary,
|
||||
outputText,
|
||||
error: String(err),
|
||||
delivered: false,
|
||||
deliveryAttempted,
|
||||
...params.telemetry,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user