Skip to content

Commit 4d33607

Browse files
fix(cron): preserve isolated agent turn payload message
1 parent 46fe1c1 commit 4d33607

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/cron/isolated-agent/run.payload-fallbacks.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe("runCronIsolatedAgentTurn — payload.fallbacks", () => {
4141

4242
it("uses the persisted agentTurn payload message when the dispatch message is malformed", async () => {
4343
mockRunCronFallbackPassthrough();
44+
const dispatchMessage = "SERIALIZATION_PROBE should not be wrapped";
4445

4546
const result = await runCronIsolatedAgentTurn(
4647
makeIsolatedAgentTurnParams({
@@ -51,14 +52,15 @@ describe("runCronIsolatedAgentTurn — payload.fallbacks", () => {
5152
"SERIALIZATION_PROBE: reply exactly with the marker token you received and nothing else.",
5253
},
5354
}),
54-
message: { message: "SERIALIZATION_PROBE should not be wrapped" } as unknown as string,
55+
message: { message: dispatchMessage } as unknown as string,
5556
}),
5657
);
5758

5859
expect(result.status).toBe("ok");
5960
expect(runEmbeddedAgentMock).toHaveBeenCalledOnce();
6061
const request = runEmbeddedAgentMock.mock.calls[0]?.[0] as { prompt?: unknown } | undefined;
6162
expect(request?.prompt).toContain("SERIALIZATION_PROBE: reply exactly");
63+
expect(request?.prompt).not.toContain(dispatchMessage);
6264
expect(request?.prompt).not.toContain("[object Object]");
6365
});
6466

0 commit comments

Comments
 (0)