fix(cron-tool): remove fallbacks from patch payload (not consumed by mergeCronPayload)

This commit is contained in:
Bruno Lorente Cantarero 2026-03-30 10:47:32 +02:00 committed by Altay
parent 314b7f96e4
commit 9676c7e888
2 changed files with 19 additions and 3 deletions

View File

@ -82,6 +82,25 @@ describe("CronToolSchema", () => {
);
});
it("job.payload includes fallbacks", () => {
expect(keysAt(CronToolSchema as Record<string, unknown>, "job.payload")).toContain("fallbacks");
});
it("patch.payload omits fallbacks (not consumed by mergeCronPayload)", () => {
expect(keysAt(CronToolSchema as Record<string, unknown>, "patch.payload")).toEqual(
[
"allowUnsafeExternalContent",
"kind",
"lightContext",
"message",
"model",
"text",
"thinking",
"timeoutSeconds",
].toSorted(),
);
});
it("job.failureAlert exposes after, channel, to, cooldownMs, mode, accountId", () => {
expect(keysAt(CronToolSchema as Record<string, unknown>, "job.failureAlert")).toEqual(
["accountId", "after", "channel", "cooldownMs", "mode", "to"].toSorted(),

View File

@ -161,9 +161,6 @@ const CronPatchObjectSchema = Type.Optional(
timeoutSeconds: Type.Optional(Type.Number()),
lightContext: Type.Optional(Type.Boolean()),
allowUnsafeExternalContent: Type.Optional(Type.Boolean()),
fallbacks: Type.Optional(
Type.Array(Type.String(), { description: "Fallback model ids" }),
),
},
{ additionalProperties: true },
),