diff --git a/src/agents/tools/cron-tool.test.ts b/src/agents/tools/cron-tool.test.ts index 4b725ac15650..2e309a6820c3 100644 --- a/src/agents/tools/cron-tool.test.ts +++ b/src/agents/tools/cron-tool.test.ts @@ -477,22 +477,18 @@ describe("cron tool", () => { expect(jobDelivery?.properties?.channel?.type).toBe("string"); expect(jobDelivery?.properties?.failureDestination?.anyOf).toBeUndefined(); expect(jobDelivery?.properties?.failureDestination?.type).toBe("object"); - expect(patch?.properties?.agentId?.anyOf?.map((entry) => entry.type)).toEqual([ - "string", - "null", - ]); - expect(patch?.properties?.sessionKey?.anyOf?.map((entry) => entry.type)).toEqual([ - "string", - "null", - ]); - expect(payload?.properties?.toolsAllow?.anyOf?.map((entry) => entry.type)).toEqual([ - "array", - "null", - ]); - expect(delivery?.properties?.channel?.anyOf?.map((entry) => entry.type)).toEqual([ - "string", - "null", - ]); + expect(patch?.properties?.agentId?.anyOf).toBeUndefined(); + expect(patch?.properties?.agentId?.type).toBe("string"); + expect(patch?.properties?.agentId?.description).toContain("null to clear"); + expect(patch?.properties?.sessionKey?.anyOf).toBeUndefined(); + expect(patch?.properties?.sessionKey?.type).toBe("string"); + expect(patch?.properties?.sessionKey?.description).toContain("null to clear"); + expect(payload?.properties?.toolsAllow?.anyOf).toBeUndefined(); + expect(payload?.properties?.toolsAllow?.type).toBe("array"); + expect(payload?.properties?.toolsAllow?.description).toContain("null to clear"); + expect(delivery?.properties?.channel?.anyOf).toBeUndefined(); + expect(delivery?.properties?.channel?.type).toBe("string"); + expect(delivery?.properties?.channel?.description).toContain("null to clear"); expect(delivery?.properties?.failureDestination?.anyOf?.map((entry) => entry.type)).toEqual([ "object", "null", diff --git a/src/agents/tools/cron-tool.ts b/src/agents/tools/cron-tool.ts index 9416fb57ecdf..71e06e030d09 100644 --- a/src/agents/tools/cron-tool.ts +++ b/src/agents/tools/cron-tool.ts @@ -79,7 +79,7 @@ function nullableStringArraySchema(description: string) { function deliveryStringSchema(params: { description: string; nullableClears: boolean }) { return params.nullableClears - ? nullableStringSchema(params.description) + ? nullableStringSchema(`${params.description}, or null to clear`) : Type.Optional(Type.String({ description: params.description })); }