From ed79bf489c58c52210f10d51af84e8806b63f4e2 Mon Sep 17 00:00:00 2001 From: CodeGhost21 <164498022+CodeGhost21@users.noreply.github.com> Date: Wed, 8 Jul 2026 02:28:24 +0530 Subject: [PATCH] fix(e2e): align harness-cron oracle + tool-call args with current cron schemas (#4646) --- .../specs/harness-cron-prompt-flow.spec.ts | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts b/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts index 0555259dd..9d14aed16 100644 --- a/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts +++ b/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts @@ -75,7 +75,21 @@ async function listCronJobs(): Promise { { id: 'call_cron_add_1', name: 'cron_add', + // `schedule` must be the tagged-union shape { kind, expr } that + // `Schedule` deserializes from; a bare cron string fails at + // `serde_json::from_value::` inside CronAddTool. arguments: JSON.stringify({ name: 'morning_reminder', - schedule: '0 9 * * *', + schedule: { kind: 'cron', expr: '0 9 * * *' }, + job_type: 'agent', prompt: 'morning reminder', - enabled: true, }), }, ], @@ -316,11 +346,13 @@ describe('Harness — Cron prompt-flow', () => { { id: 'call_cron_update_1', name: 'cron_update', + // CronUpdateTool takes `{ job_id, patch }` where `patch` is a + // CronJobPatch (schedule/command/prompt/enabled/...). The LLM + // would look up the job id from context; the mock embeds it + // directly when available, otherwise a placeholder. arguments: JSON.stringify({ - // The LLM would look up the job id from context; in the mock we - // embed it directly if available, otherwise use a placeholder. - id: jobId ?? 'morning_reminder_update_test', - schedule: '0 8 * * *', + job_id: jobId ?? 'morning_reminder_update_test', + patch: { schedule: { kind: 'cron', expr: '0 8 * * *' } }, }), }, ], @@ -396,7 +428,8 @@ describe('Harness — Cron prompt-flow', () => { { id: 'call_cron_remove_1', name: 'cron_remove', - arguments: JSON.stringify({ id: jobId ?? 'morning_reminder_delete_test' }), + // CronRemoveTool takes `{ job_id }`, not `{ id }`. + arguments: JSON.stringify({ job_id: jobId ?? 'morning_reminder_delete_test' }), }, ], },