Skip to content

Commit b83756d

Browse files
committed
fix(cron): no-deliver cron runs prefer final assistant text for recovery
When deliveryPlan.mode is "none" and no channel is resolved, resolveCronChannelOutputPolicy returned preferFinalAssistantVisibleText: false. That blocked hasRecoveredToolWarning and shouldUseFinalAssistantVisibleText in resolveCronPayloadOutcome (both gates require true), so a cron run that produced valid final assistant text after only non-fatal tool warnings was still marked as a fatal error. With no channel there is no structured delivery target; the final assistant text is the only meaningful output. Returning true lets the recovery path work correctly for --no-deliver runs. Fixes #90664
1 parent 520992a commit b83756d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/cron/isolated-agent/channel-output-policy.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ describe("cron channel output policy", () => {
3636
channelPluginMocks.getChannelPlugin.mockClear();
3737
});
3838

39+
it("prefers final assistant text when no channel is resolved", async () => {
40+
await expect(resolveCronChannelOutputPolicy(undefined)).resolves.toEqual({
41+
preferFinalAssistantVisibleText: true,
42+
});
43+
expect(channelPluginMocks.getChannelPlugin).not.toHaveBeenCalled();
44+
});
45+
3946
it("reads final visible text preference from the channel plugin", async () => {
4047
await expect(resolveCronChannelOutputPolicy("topicchat")).resolves.toEqual({
4148
preferFinalAssistantVisibleText: true,

src/cron/isolated-agent/channel-output-policy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export async function resolveCronChannelOutputPolicy(channel: string | undefined
1818
}> {
1919
const channelId = normalizeOptionalLowercaseString(channel);
2020
if (!channelId) {
21-
return { preferFinalAssistantVisibleText: false };
21+
// No channel means no structured delivery; final assistant text is the only output.
22+
return { preferFinalAssistantVisibleText: true };
2223
}
2324
const { getChannelPlugin } = await loadChannelPluginRuntime();
2425
return {

0 commit comments

Comments
 (0)