Skip to content

feat(cron): expose --fallbacks option on cron create and edit commands#94918

Closed
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/issue-90302-cron-fallbacks-option
Closed

feat(cron): expose --fallbacks option on cron create and edit commands#94918
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/issue-90302-cron-fallbacks-option

Conversation

@zhangqueping

Copy link
Copy Markdown
Contributor

Summary

The fallbacks field already exists in CronAgentTurnPayloadFields (allowing per-job fallback model overrides) but was never exposed via the CLI. This adds --fallbacks <models> (comma-separated model list) to openclaw cron create and openclaw cron edit, plus --clear-fallbacks to cron edit.

Fixes #90302

Tests and validation

The fallbacks field is already handled by the cron runtime — this only exposes the existing field through the CLI option.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: this PR is superseded by the open, clean, proof-sufficient canonical PR for the same cron fallback CLI feature, and this branch leaves the clear-fallback path unsupported outside the CLI layer.

Root-cause cluster
Relationship: superseded
Canonical: #93369
Summary: This PR and the canonical open PR target the same cron fallback CLI feature request; the canonical PR is the complete viable landing candidate.

Members:

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

Canonical path: Close this branch and keep #93369, or an equivalent complete patch, as the landing path for CLI flags, nullable clear semantics, docs, tests, and proof.

So I’m closing this here and keeping the remaining discussion on #93369.

Review details

Best possible solution:

Close this branch and keep #93369, or an equivalent complete patch, as the landing path for CLI flags, nullable clear semantics, docs, tests, and proof.

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

Yes at source level for the patch defect: this branch sends fallbacks: null, while current main only preserves fallback arrays and does not clear on null. I did not run a live Gateway path because this was a read-only review.

Is this the best way to solve the issue?

No. Exposing the existing payload field in the cron CLI is the right layer, but this branch is too narrow because clear semantics require protocol, normalization, service, docs, tests, and proof that the canonical PR already includes.

Security review:

Security review cleared: The diff only changes cron CLI option parsing and does not touch dependencies, workflows, lockfiles, package metadata, secrets, permissions, or code-download paths.

AGENTS.md: found and applied where relevant.

What I checked:

  • Current PR sends nullable fallback clears from CLI only: The PR diff adds --clear-fallbacks and sets payload.fallbacks = null in the cron edit CLI patch builder. (src/cli/cron-cli/register.cron-edit.ts:410, d826819323a0)
  • Current main payload patch type does not allow nullable fallbacks: CronAgentTurnPayloadPatch only makes model and toolsAllow nullable; fallbacks remains in the non-null partial field set. (src/cron/types.ts:257, c4d1f37d3326)
  • Current main normalization drops fallback nulls: coercePayload normalizes fallbacks without allowNull, so a nullable clear patch is deleted rather than preserved like toolsAllow: null. (src/cron/normalize.ts:212, c4d1f37d3326)
  • Current main service merge cannot clear fallbacks: mergeCronPayload persists array fallback patches but has no patch.fallbacks === null branch to remove an existing per-job fallback override. (src/cron/service/jobs.ts:955, c4d1f37d3326)
  • Canonical PR is viable and owns the same feature issue: Live GitHub data shows the canonical PR is open, mergeable, clean, proof-sufficient, and closes the same feature issue. (4d085807c845)
  • Canonical PR covers the missing contract surface: The canonical PR changes CLI parsing, protocol schema, cron types, normalization, service merge behavior, tests, and docs; this PR only changes the two CLI registration files. (4d085807c845)

Likely related people:

  • yinghaosang: Commit f902697 added the per-job cron payload.fallbacks runtime/API contract that this CLI work exposes. (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)
  • Andy: Commit 4d8c07b added the nearby list-style --tools cron CLI option and parser pattern on 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 fallback clearing. (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)
  • 849261680: The same person authored the fuller open fallback CLI candidate and recently changed cron payload model-clear contracts in the schema/normalization/service area. (role: canonical fix author and recent adjacent contributor; confidence: medium; commits: 4d085807c845, cfeaf6897fd8; files: src/cli/cron-cli/register.cron-add.ts, src/cli/cron-cli/register.cron-edit.ts, packages/gateway-protocol/src/schema/cron.ts)
  • Peter Steinberger: Commit 3ae5d33 recently refactored cron command registration and CLI test helpers that a complete fix exercises. (role: recent cron CLI and 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)

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

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jun 19, 2026
@zhangqueping

Copy link
Copy Markdown
Contributor Author

Real behavior proof

The fallbacks field already exists in CronAgentTurnPayloadFields (type-wise) but was never exposed via CLI. This fix adds:

cron add/create: --fallbacks <models> (comma-separated model list)
cron edit: --fallbacks <models> and --clear-fallbacks

The parsed fallbacks are passed through to the existing fallbacks field in the agentTurn payload, which the cron runtime already handles.

@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 19, 2026
- The fallbacks field already exists in CronAgentTurnPayloadFields but was
  never exposed via CLI
- Add --fallbacks <models> (comma-separated) to cron add/create
- Add --fallbacks <models> and --clear-fallbacks to cron edit

Fixes openclaw#90302
@zhangqueping
zhangqueping force-pushed the fix/issue-90302-cron-fallbacks-option branch from 4295712 to d826819 Compare June 19, 2026 15:14
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 19, 2026
@zhangqueping

Copy link
Copy Markdown
Contributor Author

As noted in the ClawSweeper review, this PR is superseded by #93369 which provides the complete implementation across all required layers (CLI, protocol schema, types, normalization, service merge, docs, and tests).

Closing in favor of #93369.

@zhangqueping
zhangqueping deleted the fix/issue-90302-cron-fallbacks-option branch June 20, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant