fix(cron): preserve isolated success on delivery failure#94116
Conversation
|
Thanks for the explanation. I’m only an end user and don’t understand the code details, but your conclusion makes sense to me: the isolated agent run succeeded, while the later delivery/finalization path failed. This also fits my situation at the time. I had some unstable channel delivery issues due to my network/proxy configuration. One interesting detail: the issue was mostly drafted by my own OpenClaw agent. It also failed to understand the problem clearly and partly misled me into thinking this was an agent-run failure. |
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 7:42 AM ET / 11:42 UTC. Summary PR surface: Source +20, Tests +70. Total +90 across 2 files. Reproducibility: yes. at source level: current main can return a delivery-dispatch Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Refresh or replace the branch with a narrow finalizer fix that preserves delivery-target errors, proves the real persisted cron/run-log behavior, and makes the Do we have a high-confidence way to reproduce the issue? Yes at source level: current main can return a delivery-dispatch Is this the best way to solve the issue? No, not as submitted. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1069c60e1e25. Label changesLabel justifications:
Evidence reviewedPR surface: Source +20, Tests +70. Total +90 across 2 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
|
|
Hi @yu-xin-c , I ran into a similar issue again and captured more detailed evidence, including a reduced scheduled repro. I opened a new issue here: #94846. It is related to this one, but the key difference is that delivery was not triggered at all. The isolated Could you take a look if you are interested? |
|
@yu-xin-c thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
Superseded by the landed complete fix #105215 / The final implementation keeps successful execution at Thank you for the earlier fix and regression coverage, @yu-xin-c. |
Summary
error,delivered,deliveryAttempted, and diagnostics) so cron state can recordnot-deliveredseparately from agent execution status.Fixes #94058
Root Cause
finalizeCronRunpropagated adispatchCronDeliveryresult withstatus: "error"directly when the agent payload itself was non-fatal. That collapsed delivery/finalization failures into the isolated agent execution result, so the outer scheduled run could reportstatus=erroreven though the isolated session had ended successfully.Validation
node scripts/run-vitest.mjs src/cron/isolated-agent/run.message-tool-policy.test.ts src/cron/isolated-agent/run.meta-error-status.test.ts src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts src/cron/service.runs-one-shot-main-job-disables-it.test.ts src/cron/service.persists-delivered-status.test.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental falsepnpm exec oxfmt --check --threads=1 src/cron/isolated-agent/run.ts src/cron/isolated-agent/run.message-tool-policy.test.tsgit diff --checkReal behavior proof
Behavior addressed: Scheduled isolated
agentTurnjobs could produce a successful isolated session/final assistant message, but a post-run delivery error caused the outer cron run to persiststatus=error, making the success look like an agent failure.Real environment tested: Local macOS OpenClaw source checkout at head
291dc8e6896c8cced2df1b7e5f5b5da0e100904d, with dependencies hydrated bypnpm install --frozen-lockfileand commands run from the repository root.Exact steps or command run after this patch: Ran the focused cron runner/service regression command, core typecheck, repo formatter check, and whitespace diff check listed in Validation after applying this patch.
Evidence after fix: Terminal capture from the local OpenClaw source checkout after the patch:
Observed result after fix: The new regression path verifies
runCronIsolatedAgentTurnkeeps the isolated run result atstatus: "ok"when post-run delivery fails, while preservingerror: "Message failed",delivered: false,deliveryAttempted: true, and asource: "delivery"diagnostic so the outer cron service can record delivery failure separately.What was not tested: I did not run a live scheduled gateway/cron delivery against a real chat provider; the after-fix proof is local source-checkout terminal output plus focused runner/service regression coverage.