fix(cron): add cron edit --clear-model to clear a job's model override#91625
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 11:40 AM ET / 15:40 UTC. Summary PR surface: Source +13, Tests +28, Docs +4. Total +45 across 4 files. Reproducibility: yes. Source inspection shows current main can clear Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the additive CLI flag with docs and regression coverage so users can clear cron model overrides through the existing update contract. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can clear Is this the best way to solve the issue? Yes. Mapping an additive CLI flag to the already-supported AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against da92615816b6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +13, Tests +28, Docs +4. Total +45 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
Address ClawSweeper review on openclaw#91625: the new public --clear-model CLI flag needs docs. Add it beside the existing --model param and the API model:null clear guidance in the cron CLI reference and automation guide. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@clawsweeper re-review — addressed the docs finding: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Address ClawSweeper re-review on openclaw#91625: the help text and docs said --clear-model reverts to the agent/default model, but clearing the per-job model restores normal cron model-selection precedence — a stored cron-session override still applies if set. Reword help string and both cron docs to state precedence accurately. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@clawsweeper re-review — addressed the P1 precedence accuracy point: the |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review — the previous review run reported "Review did not complete" and reverted the rating to off-meta. Re-requesting a clean pass. No behavior changed since the diamond-lobster proof run: commit 5a394e7 only reworded the |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
The cron.update RPC already clears payload.model via model:null (openclaw#91298), but CLI cron edit had no flag to send it, unlike --clear-tools for the sibling toolsAllow. Add --clear-model mirroring that pattern, and reject --model + --clear-model together. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address ClawSweeper review on openclaw#91625: the new public --clear-model CLI flag needs docs. Add it beside the existing --model param and the API model:null clear guidance in the cron CLI reference and automation guide. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address ClawSweeper re-review on openclaw#91625: the help text and docs said --clear-model reverts to the agent/default model, but clearing the per-job model restores normal cron model-selection precedence — a stored cron-session override still applies if set. Reword help string and both cron docs to state precedence accurately. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
5a394e7 to
5eff2ff
Compare
Summary
cron.updatealready supports clearing a cron job'spayload.modeloverride by sendingmodel: null(landed via cron payload.model cannot be cleared via update API (silent no-op on null/empty) #91298 — the patch schema,normalizeCronJobPatch, andmergeCronPayloadall honornullas "delete this key").openclaw cron edithas no way to send it:--modelonly sets a value (an empty string is silently ignored), and there is no--clear-modelflag — unlike the sibling fieldtoolsAllow, which has--clear-tools. So cron payload.model cannot be cleared via update API (silent no-op on null/empty) #91298's fix is unreachable from the CLI, the most common install/edit path, and a model override stuck on a cron job cannot be removed without hand-editing gateway state.--clear-modeltocron edit, mirroring the existing--clear-toolsflag.Root cause
src/cli/cron-cli/register.cron-edit.tsonly ever assignsmodelwhen it is truthy:There was no clear flag, so the CLI could never produce the
model: nullpatch thatmergeCronPayload(src/cron/service/jobs.ts) already honors:--clear-toolsalready demonstrates the intended pattern for the siblingtoolsAllowfield (payload.toolsAllow = null).What changed (
src/cli/cron-cli/register.cron-edit.ts)--clear-modeloption.--model+--clear-modeltogether (matches the existing--agent/--clear-agentand--session-key/--clear-session-keyguards).--clear-modelin the agentTurn-payload trigger so a clear-only edit still builds the patch.payload.model = nullwhen--clear-modelis set (mirrors--clear-tools→toolsAllow: null).Net
+10 / -1in prod,+28test.Scope boundary
Only
modelis addressed: its RPC null-clear already shipped (#91298), so the CLI flag is the sole missing piece. Sibling agentTurn override fields (thinking,fallbacks) are not yet clearable at the RPC layer either — open PR #67429 adds that — so their CLI clear flags are the natural follow-up once #67429 lands. This change is orthogonal to #67429 (no shared files, no overlap).Change Type
Linked Issue
Source-discovered while reading the cron clear-override paths. Completes the CLI half of #91298 (model-clear); related: #67429 (RPC null-clear for
fallbacks/thinking).Evidence
clears the model override with --clear-modelassertscron edit <id> --clear-modelsends{ payload: { kind: "agentTurn", model: null } }. Before this change the flag does not exist, so the parse errors withunknown option '--clear-model'. New help-doc test asserts--clear-modelis documented alongside--clear-tools. Full file: 6/6 tests pass (Node 22.22.1).Real behavior proof
Behavior addressed:
openclaw cron edit <id> --clear-modelnow removes a cron job'spayload.modeloverride (reverting the job to the agent/default model); previously there was no CLI way to clear it.Real environment tested: local OpenClaw dev gateway (
gateway run --dev --auth none) on Node 22.22.1 (macOS), isolatedOPENCLAW_STATE_DIR/OPENCLAW_HOME, CLI driven viascripts/run-node.mjsagainst the live gateway RPC.Exact steps or command run after this patch:
Evidence after fix (live gateway output, payload read back via
cron list --json):Observed result after fix: the
modelkey is deleted from the stored cron payload (job now runs on the agent/default model); passing both--modeland--clear-modelis rejected.What was not tested: a live agent run of the cleared cron job (the clearing behavior is fully observable in the persisted payload via the gateway; running the job would require a real model/provider).
Compatibility / Migration
Backward compatible — purely additive CLI flag. No config/schema/migration changes (the Gateway already accepts
model: nulloncron.update).AI assistance
AI-assisted (Claude Code). Verified locally: 6/6 unit tests, oxlint clean, oxfmt clean, and the live before/after gateway proof above. Author understands the change.