mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(cron): trust agent output when channel is unresolved without explicit delivery (#92817)
resolveCronChannelOutputPolicy checked deliveryRequested === false when there is no channel. Since deliveryRequested is optional (?: boolean), undefined and missing opts both returned false, blocking the hasRecoveredToolWarning rescue path for --no-deliver cron runs whose agent recovered successfully. Change === false to !== true: when no channel exists, prefer the agent's final visible text unless delivery was explicitly requested. Fixes #90664 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -56,6 +56,16 @@ describe("cron channel output policy", () => {
|
||||
).resolves.toEqual({
|
||||
preferFinalAssistantVisibleText: false,
|
||||
});
|
||||
// deliveryRequested is optional — undefined and missing opts are
|
||||
// equivalent to "not requested" (no channel to deliver to). #90664
|
||||
await expect(
|
||||
resolveCronChannelOutputPolicy(undefined, { deliveryRequested: undefined }),
|
||||
).resolves.toEqual({
|
||||
preferFinalAssistantVisibleText: true,
|
||||
});
|
||||
await expect(resolveCronChannelOutputPolicy(undefined)).resolves.toEqual({
|
||||
preferFinalAssistantVisibleText: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("lets channel plugins format current tool context targets", async () => {
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function resolveCronChannelOutputPolicy(
|
||||
}> {
|
||||
const channelId = normalizeOptionalLowercaseString(channel);
|
||||
if (!channelId) {
|
||||
return { preferFinalAssistantVisibleText: opts?.deliveryRequested === false };
|
||||
return { preferFinalAssistantVisibleText: opts?.deliveryRequested !== true };
|
||||
}
|
||||
const { getChannelPlugin } = await loadChannelPluginRuntime();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user