fix(cron-tool): add typed properties to job/patch schemas#55043
Conversation
Greptile SummaryThis PR replaces the opaque Key changes:
One P1 bug found: the new schedule-pruning block in Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/cron/normalize.ts
Line: 92-96
Comment:
**`staggerMs` silently deleted for `kind=every` schedules**
`staggerMs` is the random-jitter field explicitly tied to `kind=every` — the schema description reads `"Random jitter in ms (kind=every)"` and the `CronScheduleSchema` places it alongside `everyMs` and `anchorMs`. The pruning block above (lines 79-84) already normalises `staggerMs` correctly via `normalizeCronStaggerMs`; if it was valid, `next.staggerMs` is set before this block executes. The `delete next.staggerMs` inside the `kind === "every"` branch then silently discards it on every `every` schedule, regardless of whether the value was legitimately set.
`staggerMs` should be removed from the `kind === "every"` branch (it belongs there, not in `kind === "at"` or `kind === "cron"`):
```suggestion
} else if (next.kind === "every") {
delete next.at;
delete next.expr;
delete next.tz;
} else if (next.kind === "cron") {
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (4): Last reviewed commit: "fix: preserve explicit cron delivery int..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71bd5d9342
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2096292eb5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4411b27b4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thanks for tackling the
I’d expand the schema to match the actual cron contract first, then add a schema-level regression test before landing. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f277ed22e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
5f277ed to
e6dcc36
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6dcc36479
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
7e1ac01 to
99b13f5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99b13f517b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thanks for the review @altaywtf! pushed the fixes:
CI is failing on |
99b13f5 to
28f6484
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f284633627
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@altaywtf :) |
|
@brunolorente checking, will rebase and take from there thank you! |
f284633 to
71aeafa
Compare
71aeafa to
48fac5d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09056d5a97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
611e046 to
09bb27b
Compare
Spell out sub-properties in CronToolSchema so that strict models
(e.g. GPT-5.4) know which fields to populate instead of sending
job: {}.
Addresses review feedback:
- Add schema regression test (non-empty job/patch properties)
- Add missing patch fields: agentId, sessionKey, failureAlert
- Add missing nested fields: schedule.staggerMs, delivery.accountId,
delivery.failureDestination (object), payload.allowUnsafeExternalContent,
payload.fallbacks
- failureAlert accepts false | object to match runtime contract
- failureDestination modelled as object (channel/to/accountId/mode)
Runtime validation in normalizeCronJobCreate/Patch is unchanged.
additionalProperties: true preserved everywhere.
Fixes openclaw#55035
- Remove Type.Union from failureAlert (avoid anyOf in tool schemas) - Remove unused failureAlert.enabled field - Add failureAlert.channel and failureAlert.to (consumed by mergeCronFailureAlert) - Improve schema regression test with exact field-list assertions
…mergeCronPayload)
09bb27b to
979bb0e
Compare
|
Merged via squash.
Thanks @brunolorente! |
…5043) Merged via squash. Prepared head SHA: 979bb0e Co-authored-by: brunolorente <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…5043) Merged via squash. Prepared head SHA: 979bb0e Co-authored-by: brunolorente <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…5043) Merged via squash. Prepared head SHA: 979bb0e Co-authored-by: brunolorente <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…5043) Merged via squash. Prepared head SHA: 979bb0e Co-authored-by: brunolorente <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…5043) Merged via squash. Prepared head SHA: 979bb0e Co-authored-by: brunolorente <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…5043) Merged via squash. Prepared head SHA: 979bb0e Co-authored-by: brunolorente <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Problem
CronToolSchemadefinesjobandpatchasType.Object({}, { additionalProperties: true }), producing"properties": {}. Strict models (GPT-5.4) follow the schema literally and sendjob: {}, which the gateway rejects.Closes #55035
Solution
Spell out the sub-properties for
job,patch, and their nested objects (schedule,payload,delivery,failureAlert) so that models know which fields to send.What does NOT change
normalizeCronJob*)additionalProperties: true(preserved everywhere)Tests
cron-tool.schema.test.ts: 6 regression tests that assert the exact field list forjob,patch, and nested objects. Any accidental field removal breaks the test.