Skip to content

fix(cron): expose per-job fallbacks in CLI#93369

Merged
openclaw-clownfish[bot] merged 1 commit into
openclaw:mainfrom
849261680:fix/90302-cron-fallbacks
Jun 22, 2026
Merged

fix(cron): expose per-job fallbacks in CLI#93369
openclaw-clownfish[bot] merged 1 commit into
openclaw:mainfrom
849261680:fix/90302-cron-fallbacks

Conversation

@849261680

@849261680 849261680 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes [Feature]: Expose --fallbacks on openclaw cron create/edit #90302 by adding --fallbacks <list> to openclaw cron add/create and openclaw cron edit.
  • Adds cron edit --clear-fallbacks so jobs can return from a persisted per-job fallback override back to configured fallback inheritance.
  • Keeps the runtime/protocol semantics explicit: fallback arrays set overrides, [] is strict mode, and null is accepted only as an update-patch clear signal.

Verification

  • pnpm docs:list
  • node scripts/run-vitest.mjs src/cli/cron-cli.test.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/service.jobs.test.ts src/cron/normalize.test.ts
  • pnpm protocol:check
  • pnpm exec oxfmt --check --threads=1 packages/gateway-protocol/src/schema/cron.ts src/cron/types.ts src/cron/normalize.ts src/cron/service/jobs.ts src/cli/cron-cli/shared.ts src/cli/cron-cli/register.cron-add.ts src/cli/cron-cli/register.cron-edit.ts src/cli/cron-cli.test.ts src/cron/normalize.test.ts src/cron/service.jobs.test.ts
  • node scripts/format-docs.mjs --check docs/automation/cron-jobs.md docs/cli/cron.md
  • pnpm dlx --config.resolution-mode=highest markdownlint-cli2 --config config/markdownlint-cli2.jsonc docs/automation/cron-jobs.md docs/cli/cron.md
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode local (clean after addressing two accepted findings)

Real behavior proof

Behavior addressed: openclaw cron add/create and openclaw cron edit can now expose per-job fallback controls; cron edit --clear-fallbacks removes the persisted override so configured fallback inheritance applies again.

Real environment tested: Local macOS OpenClaw source worktree on branch fix/90302-cron-fallbacks after rebasing onto latest upstream/main; executed the patched cron CLI registration with Node 24-era ESM loading through tsx.

Exact steps or command run after this patch: Ran the cron CLI registration in-process and printed the fallback-related options registered on the real cron add and cron edit Commander commands.

Evidence after fix: Terminal output from the patched worktree:

$ node --import tsx -e 'import { Command } from "commander"; import { registerCronCli } from "./src/cli/cron-cli.js"; const program = new Command(); registerCronCli(program); const cron = program.commands.find((cmd) => cmd.name() === "cron"); const add = cron?.commands.find((cmd) => cmd.name() === "add"); const edit = cron?.commands.find((cmd) => cmd.name() === "edit"); console.log("cron add fallback options:"); console.log(add?.options.filter((opt) => opt.long?.includes("fallback")).map((opt) => `${opt.flags} :: ${opt.description}`).join("\n")); console.log("cron edit fallback options:"); console.log(edit?.options.filter((opt) => opt.long?.includes("fallback")).map((opt) => `${opt.flags} :: ${opt.description}`).join("\n"));'
cron add fallback options:
--fallbacks <list> :: Fallback model list for agent jobs
cron edit fallback options:
--fallbacks <list> :: Fallback model list for agent jobs
--clear-fallbacks :: Remove per-job fallback override

Observed result after fix: The actual cron CLI registration now exposes --fallbacks <list> on cron add (shared by the create alias) and exposes both --fallbacks <list> and --clear-fallbacks on cron edit. The focused RPC-payload coverage listed above verifies those options serialize to fallback arrays, strict [], and nullable clear patches.

What was not tested: I did not create a persistent cron job in a personal Gateway state store; the live terminal proof covers the user-visible CLI surface, while the focused verification covers RPC payload construction, protocol/schema generation, normalization, service merge, and existing isolated-run fallback behavior.

@849261680
849261680 requested a review from a team as a code owner June 15, 2026 16:38
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 20, 2026, 3:44 PM ET / 19:44 UTC.

Summary
This branch adds --fallbacks and --clear-fallbacks cron CLI controls plus nullable fallback-clear update semantics across CLI, Gateway protocol schema, cron normalization/service logic, tests, and docs.

PR surface: Source +37, Tests +101, Docs +6. Total +144 across 12 files.

Reproducibility: yes. at source level: current main has payload.fallbacks runtime/API support but current cron add/edit option lists and payload builders lack --fallbacks and --clear-fallbacks. The PR body also supplies terminal proof that the patched CLI registration exposes the new options.

Review metrics: 2 noteworthy metrics.

  • CLI fallback controls: 2 added. --fallbacks and --clear-fallbacks are new user-facing cron CLI controls that affect scheduled-run model fallback routing.
  • Cron payload patch contract: 1 changed. The update contract now accepts fallbacks: null as a clear signal, so protocol, normalization, service behavior, docs, and tests need to stay aligned before merge.

Root-cause cluster
Relationship: canonical
Canonical: #93369
Summary: This PR is the open canonical implementation candidate for the cron fallback CLI feature request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P2] Merging introduces a new CLI/protocol way to override and clear scheduled-run model fallback chains, so maintainers should consciously accept the model-routing behavior; the missing persistent Gateway state round-trip is mitigated by terminal CLI proof plus focused CLI, protocol, normalization, and service tests.

Maintainer options:

  1. Land With The Complete Contract (recommended)
    Accept the residual proof gap and land this complete CLI/protocol/service/docs/test path after normal maintainer review.
  2. Ask For A Persistent Gateway Round Trip
    Before merge, require one more terminal proof that creates or edits a real persisted cron job and then reads back the fallback override or clear state.
  3. Pause If The CLI Surface Is Not Wanted
    If maintainers do not want per-job fallback controls exposed in the CLI yet, pause or close this PR and keep the discussion on the linked feature issue.

Next step before merge

  • Maintainers should review and land or decline the canonical PR; there is no automated repair to queue because no actionable code finding remains.

Security
Cleared: The diff changes cron CLI parsing, protocol schema/types, service merge logic, tests, and docs without touching dependencies, workflows, secrets, package metadata, permissions, or code-download paths.

Review details

Best possible solution:

Land this PR or an equivalent complete patch that keeps cron CLI flags, nullable fallback-clear semantics, docs, and focused cron coverage together.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main has payload.fallbacks runtime/API support but current cron add/edit option lists and payload builders lack --fallbacks and --clear-fallbacks. The PR body also supplies terminal proof that the patched CLI registration exposes the new options.

Is this the best way to solve the issue?

Yes: exposing the existing per-job payload field in the cron CLI while aligning nullable clear semantics through protocol schema, normalization, service behavior, docs, and tests is the narrow complete fix. A CLI-only change would leave the clear path unsupported outside argument parsing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6a3f990140d8.

Label changes

Label justifications:

  • P3: This is a low-risk cron CLI ergonomics feature for an existing per-job fallback capability, not an urgent regression.
  • merge-risk: 🚨 auth-provider: The PR changes scheduled agent-run model fallback routing and clear semantics, which can alter provider/model choice for cron jobs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes terminal output from the patched worktree showing real cron CLI registration exposes --fallbacks on add/edit and --clear-fallbacks on edit.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal output from the patched worktree showing real cron CLI registration exposes --fallbacks on add/edit and --clear-fallbacks on edit.
Evidence reviewed

PR surface:

Source +37, Tests +101, Docs +6. Total +144 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 41 4 +37
Tests 3 101 0 +101
Docs 2 9 3 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 151 7 +144

What I checked:

  • Repository policy read: Root AGENTS.md and scoped docs guidance were read; the review applied the policy that fallback behavior, CLI/API surfaces, docs, and tests need whole-path inspection before a PR verdict. (AGENTS.md:1, 6a3f990140d8)
  • Current-main CLI gap: Current main registers adjacent cron add agent options like --model and --tools, but there is no --fallbacks option and the agentTurn payload builder does not assign fallbacks from CLI input. (src/cli/cron-cli/register.cron-add.ts:126, 6a3f990140d8)
  • Current-main edit gap: Current main registers --model, --clear-model, --tools, and --clear-tools for cron edit, but no --fallbacks or --clear-fallbacks controls. (src/cli/cron-cli/register.cron-edit.ts:114, 6a3f990140d8)
  • Existing runtime fallback contract: Current main already has CronAgentTurnPayloadFields.fallbacks?: string[], and isolated cron fallback policy gives explicit payload fallbacks precedence over subagent/default fallback policy. (src/cron/types.ts:240, 6a3f990140d8)
  • PR CLI set/clear path: The PR branch adds --fallbacks and --clear-fallbacks to cron edit, parses fallback lists, includes fallback-only edits in the agentTurn patch decision, and serializes arrays or null into the payload patch. (src/cli/cron-cli/register.cron-edit.ts:116, 4d085807c845)
  • PR add path: The PR branch adds --fallbacks to cron add/create and passes parseCronFallbacks(opts.fallbacks) into the agentTurn create payload. (src/cli/cron-cli/register.cron-add.ts:128, 4d085807c845)

Likely related people:

  • yinghaosang: Commit f902697 added per-job cron payload.fallbacks runtime/API support, which is the capability this PR exposes through CLI flags. (role: introduced payload fallback capability; confidence: high; commits: f902697bd5c4; files: src/cron/types.ts, packages/gateway-protocol/src/schema/cron.ts, src/cron/isolated-agent/run.payload-fallbacks.test.ts)
  • andyk-ms: Commit 4d8c07b added the analogous list-style --tools cron CLI option and parser pattern in the same add/edit command surface. (role: adjacent CLI option contributor; confidence: medium; commits: 4d8c07b97c0b; files: src/cli/cron-cli/register.cron-add.ts, src/cli/cron-cli/register.cron-edit.ts, src/cli/cron-cli/shared.ts)
  • ly-wang19: Commit 0888deb added cron edit --clear-model, the existing clear-override CLI pattern mirrored by --clear-fallbacks. (role: adjacent clear-override contributor; confidence: medium; commits: 0888debcd3eb; files: src/cli/cron-cli/register.cron-edit.ts, docs/automation/cron-jobs.md, docs/cli/cron.md)
  • steipete: Commit 3ae5d33 refactored cron command registration and CLI test helpers that this branch extends. (role: recent cron CLI/test refactor contributor; confidence: medium; commits: 3ae5d337997e; files: src/cli/cron-cli/register.cron-add.ts, src/cli/cron-cli/register.cron-edit.ts, src/cli/cron-cli.test.ts)
  • 849261680: Commit cfeaf68 changed cron payload model-clear contracts in the same schema/normalization/service area, and this person authored the current fuller candidate fix. (role: recent adjacent contributor and candidate fix author; confidence: medium; commits: cfeaf6897fd8, 4d085807c845; files: packages/gateway-protocol/src/schema/cron.ts, src/cron/normalize.ts, src/cron/service/jobs.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 15, 2026
@849261680
849261680 force-pushed the fix/90302-cron-fallbacks branch from e9180b6 to 4d08580 Compare June 16, 2026 14:43
@clawsweeper

clawsweeper Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 16, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 16, 2026
@849261680

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jun 19, 2026
@openclaw-clownfish
openclaw-clownfish Bot merged commit 1662b07 into openclaw:main Jun 22, 2026
219 of 229 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Expose --fallbacks on openclaw cron create/edit

1 participant