mirror of https://github.com/openclaw/openclaw.git
* fix(cron): recover flat params when LLM omits job wrapper (#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (#12124) (thanks @tyler6204) |
||
|---|---|---|
| .. | ||
| isolated-agent | ||
| service | ||
| cron-protocol-conformance.test.ts | ||
| delivery.test.ts | ||
| delivery.ts | ||
| isolated-agent.delivers-response-has-heartbeat-ok-but-includes.test.ts | ||
| isolated-agent.skips-delivery-without-whatsapp-recipient-besteffortdeliver-true.test.ts | ||
| isolated-agent.ts | ||
| isolated-agent.uses-last-non-empty-agent-text-as.test.ts | ||
| normalize.test.ts | ||
| normalize.ts | ||
| parse.ts | ||
| payload-migration.ts | ||
| run-log.test.ts | ||
| run-log.ts | ||
| schedule.test.ts | ||
| schedule.ts | ||
| service.delivery-plan.test.ts | ||
| service.every-jobs-fire.test.ts | ||
| service.issue-regressions.test.ts | ||
| service.jobs.test.ts | ||
| service.prevents-duplicate-timers.test.ts | ||
| service.read-ops-nonblocking.test.ts | ||
| service.restart-catchup.test.ts | ||
| service.runs-one-shot-main-job-disables-it.test.ts | ||
| service.skips-main-jobs-empty-systemevent-text.test.ts | ||
| service.store-migration.test.ts | ||
| service.store.migration.test.ts | ||
| service.ts | ||
| store.test.ts | ||
| store.ts | ||
| types.ts | ||
| validate-timestamp.ts | ||