Skip to content

fix(cron): do not set delivery mode to announce when disabling best-effort on payload edits - #100846

Merged
steipete merged 3 commits into
openclaw:mainfrom
machine3at:fix/2.3-no-best-effort-overwrite-delivery-mode
Jul 6, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
machine3at:fix/2.3-no-best-effort-overwrite-delivery-mode

Conversation

@machine3at

@machine3at machine3at commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

When running openclaw cron edit to edit a payload (such as passing --message), if you also disable best-effort delivery via --no-best-effort-deliver, the CLI wrongly forces the delivery mode to "announce".

This happens because the logic was checking if hasBestEffort (a boolean tracking if the flag was supplied at all) was true alongside payload edits. If it was, it set the mode to "announce". However, when disabling best-effort, the user is explicitly requesting best-effort to be false, and does not want the delivery mode to be modified/overwritten to announce.

Fix

Change the condition to check if opts.bestEffortDeliver === true instead of the generic hasBestEffort flag existence check.

Test plan

Added unit test does not set delivery mode to announce when disabling best-effort on payload edits in src/cli/cron-cli/register.cron-edit.test.ts. Verified that all 22 tests passed.

Evidence

Passed tests on branch fix/2.3-no-best-effort-overwrite-delivery-mode:

 ✓ |cli| ../../src/cli/cron-cli.test.ts (106 tests)
   ✓ cron cli (106)
     ✓ applies '--best-effort-deliver' on cron edit message updates
     ✓ applies '--no-best-effort-deliver' on cron edit message updates

 ✓ |cli| src/cli/cron-cli/register.cron-edit.test.ts (22 tests)
   ✓ does not set delivery mode to announce when disabling best-effort on payload edits

Real Behavior Proof

$ node openclaw.mjs cron edit job-1 --no-best-effort-deliver --message "new message"
# Resolved payload patch:
# {
#   id: "job-1",
#   patch: {
#     payload: { kind: "agentTurn", message: "new message" },
#     delivery: { bestEffort: false }
#   }
# }
# Resulting delivery mode remains unchanged (undefined in patch, avoiding "announce" override)

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 11:33 AM ET / 15:33 UTC.

Summary
Updates cron edit patch construction so --no-best-effort-deliver with payload edits sets only delivery.bestEffort=false, adjusts cron CLI tests for both best-effort polarities, and removes duplicate gateway-protocol type re-exports.

PR surface: Source -1, Tests +25. Total +24 across 4 files.

Reproducibility: yes. from source inspection: current main treats any boolean best-effort flag as enough to set delivery.mode="announce" when payload fields are edited. I did not execute the CLI locally during this read-only review.

Review metrics: 1 noteworthy metric.

  • Implicit cron delivery-mode path: 1 changed condition. The changed condition decides whether cron edit includes delivery.mode, which affects existing scripts using best-effort flags with payload edits.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
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

  • [P1] Existing scripts that combined --no-best-effort-deliver with a payload edit and relied on the old implicit announce patch will now preserve the stored delivery mode instead; that is the intended semantic fix, but it is still a delivery compatibility change.

Maintainer options:

  1. Accept the flag-semantic change (recommended)
    Land after acknowledging that --no-best-effort-deliver with payload edits preserves the existing delivery mode instead of forcing announce.
  2. Preserve old implicit announce behavior
    Ask for a revised patch that keeps the old behavior by default and adds a separate explicit path for preserving mode when disabling best-effort.

Next step before merge

  • No automated repair is needed; the patch is correct, but the intentional delivery compatibility change needs maintainer acceptance before merge.

Maintainer decision needed

  • Question: Should this PR intentionally stop --no-best-effort-deliver plus payload edits from forcing delivery.mode="announce"?
  • Rationale: The patch is technically narrow and correct, but it changes behavior for any existing automation that used the false flag plus payload edits as an implicit announce-mode update.
  • Likely owner: steipete — The live PR is assigned to @steipete, and the remaining question is a maintainer merge-risk decision rather than a code repair.
  • Options:
    • Accept the semantic fix (recommended): Land the PR with the current tests and proof, accepting that the false flag no longer implies announce mode.
    • Require old compatibility: Ask for a different patch that preserves the previous implicit announce behavior unless a new explicit opt-out is used.
    • Pause for cron owner: Hold the PR until a cron delivery owner decides whether this compatibility break is acceptable.

Security
Cleared: The diff changes cron CLI patch construction, tests, and duplicate protocol type re-exports; it does not add dependencies, scripts, secret handling, or new code-execution paths.

Review details

Best possible solution:

Land the CLI condition and regression tests after maintainer acceptance of the intentional delivery compatibility change, keeping explicit --best-effort-deliver and --announce behavior covered.

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

Yes, from source inspection: current main treats any boolean best-effort flag as enough to set delivery.mode="announce" when payload fields are edited. I did not execute the CLI locally during this read-only review.

Is this the best way to solve the issue?

Yes. Changing the cron edit patch construction is the narrow owner-boundary fix because cron.update already preserves stored delivery mode when patch.delivery.mode is omitted.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output showing the resolved cron edit patch with delivery.bestEffort=false and no delivery.mode, and the latest real-behavior-proof check succeeded.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output showing the resolved cron edit patch with delivery.bestEffort=false and no delivery.mode, and the latest real-behavior-proof check succeeded.

Label justifications:

  • P2: This is a focused cron CLI bug fix with limited blast radius, but it changes message-delivery behavior for a specific flag combination.
  • merge-risk: 🚨 compatibility: Merging changes the upgrade behavior of existing openclaw cron edit --no-best-effort-deliver --message ... scripts that previously forced announce mode.
  • merge-risk: 🚨 message-delivery: The patch can change whether a cron payload edit emits an announce delivery mode, which can suppress or preserve delivery depending on the job's stored mode.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 after-fix terminal output showing the resolved cron edit patch with delivery.bestEffort=false and no delivery.mode, and the latest real-behavior-proof check succeeded.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output showing the resolved cron edit patch with delivery.bestEffort=false and no delivery.mode, and the latest real-behavior-proof check succeeded.
Evidence reviewed

PR surface:

Source -1, Tests +25. Total +24 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 2 3 -1
Tests 2 33 8 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 35 11 +24

What I checked:

  • Current-main bug source: Current origin/main still sets delivery.mode = "announce" when a payload field is edited and any boolean best-effort flag is present, so --no-best-effort-deliver --message ... enters the announce branch. (src/cli/cron-cli/register.cron-edit.ts:503, 9606fe43231b)
  • PR fix source: The PR head narrows the implicit announce branch to opts.bestEffortDeliver === true, so the false flag no longer forces announce mode on payload edits. (src/cli/cron-cli/register.cron-edit.ts:486, 2b9cd21f6f08)
  • Cron update merge semantics: mergeCronDelivery preserves the existing delivery mode unless patch.mode is present and independently applies patch.bestEffort, so omitting mode is the right way to avoid overwriting the stored mode. (src/cron/service/jobs.ts:1231, 9606fe43231b)
  • Regression tests: The PR adds a narrow register test for --no-best-effort-deliver plus --message, and updates the broader cron CLI table so the false flag expects an undefined delivery mode. (src/cli/cron-cli/register.cron-edit.test.ts:79, 2b9cd21f6f08)
  • Gateway-protocol export check: Current main still exports SessionWorktreeInfo and SessionsCreateResult through the dedicated type export block, while the schema export block keeps only schemas, so the PR's duplicate-export cleanup does not remove the public type names. (packages/gateway-protocol/src/index.ts:392, 9606fe43231b)
  • CI and proof status: Live PR status shows successful check-test-types, check-prod-types, checks-fast-bundled-protocol, and Real behavior proof runs for the reviewed head; earlier cancelled proof runs were superseded by successful runs. (2b9cd21f6f08)

Likely related people:

  • momothemage: Git blame points the current announce-condition branch and adjacent cron/protocol surface to commit 17605c57df2685dfc6e02e826d13f711be72fd25, which corresponds to merged work in improve: reduce repeated session startup scans #99335 authored by @momothemage. (role: introduced current behavior; confidence: high; commits: 17605c57df26; files: src/cli/cron-cli/register.cron-edit.ts, src/cli/cron-cli.test.ts, packages/gateway-protocol/src/index.ts)
  • machine3at: The author also has prior merged cron-edit work in fix(cron): use direct lookup instead of paginated search in cron edit #100836, which changed src/cli/cron-cli/register.cron-edit.ts and adjacent tests earlier the same day. (role: recent adjacent contributor; confidence: medium; commits: 5c2604f8cd85; files: src/cli/cron-cli/register.cron-edit.ts, src/cli/cron-cli.test.ts)
  • steipete: The live PR timeline shows @steipete assigned himself on 2026-07-06T15:04:03Z, making him the likely owner for the remaining merge-risk decision. (role: assigned follow-up owner; confidence: high)
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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-06T11:41:57.414Z sha 520807ce9b72678b02ac1e7e49307bbab14bcf03 :: needs real behavior proof before merge. :: [P2] Update the broader cron CLI contract test

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime labels Jul 6, 2026
@machine3at

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 6, 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.

@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 6, 2026
@steipete steipete self-assigned this Jul 6, 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. labels Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed app: web-ui App: web-ui gateway Gateway runtime labels Jul 6, 2026
@machine3at

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 6, 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.

@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Maintainer repair is land-ready at 42da6157b053e35a2e5ca0dc6928ae7de5396ce1.

  • Before: cron edit --no-best-effort-deliver plus a payload edit could emit delivery.mode = "announce", overwriting the stored mode.
  • After: only the positive flag retains the shipped announce implication; the negative flag emits bestEffort: false without changing mode.
  • Repair: removed stale unrelated protocol drift, simplified the condition, and retained focused plus broad regression coverage.
  • Local lightweight checks: git diff --check; targeted formatting was verified with oxfmt.
  • Exact-head proof: full hosted CI is green: https://github.com/openclaw/openclaw/actions/runs/28804356884
  • Fresh autoreview: no accepted/actionable findings.

Known gap: no live Gateway cron round-trip was run; deterministic CLI patch-construction tests and the full exact-head suite cover the repaired owner boundary.

@steipete
steipete merged commit f1fb193 into openclaw:main Jul 6, 2026
99 of 101 checks passed
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…ffort on payload edits (openclaw#100846)

* fix(cron): do not set delivery mode to announce when disabling best-effort on payload edits

* fix(cron-cli): update sibling test to expect undefined mode on no-best-effort-deliver

* fix(cron): preserve delivery mode when disabling best effort

---------

Co-authored-by: Peter Steinberger <[email protected]>
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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

2 participants