Skip to content

Commit 31437b9

Browse files
committed
test(cron): cover message tool with no delivery
1 parent 3b9e0da commit 31437b9

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/cron/isolated-agent/run.message-tool-policy.test.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ describe("runCronIsolatedAgentTurn message tool policy", () => {
4747
expect(runEmbeddedPiAgentMock.mock.calls[0]?.[0]?.disableMessageTool).toBe(true);
4848
}
4949

50+
async function expectMessageToolEnabledForPlan(plan: {
51+
requested: boolean;
52+
mode: "none" | "announce";
53+
channel?: string;
54+
to?: string;
55+
}) {
56+
mockRunCronFallbackPassthrough();
57+
resolveCronDeliveryPlanMock.mockReturnValue(plan);
58+
await runCronIsolatedAgentTurn(makeParams());
59+
expect(runEmbeddedPiAgentMock).toHaveBeenCalledTimes(1);
60+
expect(runEmbeddedPiAgentMock.mock.calls[0]?.[0]?.disableMessageTool).toBe(false);
61+
}
62+
5063
beforeEach(() => {
5164
previousFastTestEnv = clearFastTestEnv();
5265
resetRunCronIsolatedAgentTurnHarness();
@@ -63,8 +76,8 @@ describe("runCronIsolatedAgentTurn message tool policy", () => {
6376
restoreFastTestEnv(previousFastTestEnv);
6477
});
6578

66-
it('disables the message tool when delivery.mode is "none"', async () => {
67-
await expectMessageToolDisabledForPlan({
79+
it('keeps the message tool enabled when delivery.mode is "none"', async () => {
80+
await expectMessageToolEnabledForPlan({
6881
requested: false,
6982
mode: "none",
7083
});

0 commit comments

Comments
 (0)