Repository navigation
Conversation
When an agent hit an unrecoverable error (e.g. missing mount) and exited with NO_REPLY, the cron scheduler treated the silent reply token as valid final assistant output — hasRecoveringTerminalOutput was true, the error was downgraded to non-fatal, and the run was recorded as status: ok. This cleared consecutiveErrors and suppressed failureAlert. Filter NO_REPLY (SILENT_REPLY_TOKEN) from the recovery signal so a preceding error payload stays fatal. The silent reply is the agent choosing to emit nothing, not proof of recovery. (openclaw#116731)
|
Codex review: needs real behavior proof before merge. Reviewed August 7, 2026, 4:34 AM ET / 08:34 UTC. ClawSweeper reviewWhat this changesThe PR excludes canonical silent replies from isolated-cron recovery and adds regression coverage from payload classification through persisted cron failure state. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 6 items remain Keep open: the NO_REPLY recovery repair is still needed, but the latest status-mapper refactor introduces a P1 regression that can turn a promoted cron failure back into Priority: P1 Review scores
Verification
How this fits togetherIsolated cron runs classify agent payloads into a terminal status, then the cron service persists error streaks and emits failure alerts. The finalizer must preserve any error promoted after delivery handling so scheduler state reflects the actual outcome. flowchart LR
A[Agent payloads] --> B[Payload outcome]
C[Final assistant reply] --> B
B --> D[Cron finalizer]
D --> E[Delivery warning decision]
E --> F[Terminal run status]
F --> G[Persisted error streak]
G --> H[Failure alert]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +20, Tests +203. Total +223 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the canonical silent-payload predicate in the payload-outcome owner, but derive terminal status from the post-delivery fatal state and demonstrate the repaired cron path with redacted after-fix runtime evidence. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main’s nonempty-final-text recovery path reaches an Is this the best way to solve the issue? No. Filtering canonical silent payloads at the payload-outcome owner is the right repair, but the mapper must read the current post-delivery fatal state rather than the immutable initial outcome. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aa7cf44c75a1. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
…s stay non-recovery ClawSweeper P1: the prior token-only isSilentReplyText let JSON-string, action-envelope, and reasoning-prefixed silent replies recover a preceding error payload, dropping hasFatalErrorPayload and clearing the error streak. Switch to isSilentReplyPayloadText (the same classifier cron finalization uses for the terminal field) so every silent form keeps a preceding error fatal. Table-driven regression covers all four silent forms. (openclaw#116731)
|
P1 code finding addressed: switched the recovery predicate from the token-only Added a real cron-path proof driving the real Head: 67b736f @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
… + real applyJobResult Add a committed integration test that drives the REAL resolveCronPayloadOutcome (the cron finalization classifier at run-finalize.ts:251) through the run-finalize finalStatus mapping (run-finalize.ts:301) into the REAL applyJobResult (the persisted timer-state update at timer-outcomes.ts:144). An error payload plus any silent (NO_REPLY) final assistant text stays fatal, marks the run 'error', and increments consecutiveErrors so failureAlert can fire; a recovering final answer resets the streak. No mock stands in for resolveCronPayloadOutcome or applyJobResult. Also shorten the recovery-invariant comment to three lines (drop PR-specific lore and examples already covered by the table test) per review. (openclaw#116731)
|
Re-review request — addressed both remaining items on head b207721:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…tion mapper (openclaw#116731) Extract resolveCronRunFinalStatus as the single exported production mapper from cron payload outcome to terminal run status, and use it at both finalization sites in run-finalize.ts (diagnostics finalStatus and run status). This removes the two inline copies of the status ternary so finalization diagnostics, run status, and downstream timer/alert state share one source of truth. Rewrite the streak proof to route through the REAL shared mapper (not a copied ternary) and the REAL finalizeCompletedCronRunOutcomes, which persists job state and emits the failure alert. The test now asserts DURABLE state reloaded from the store (consecutiveErrors, lastRunStatus) and a FIRED alert (lastFailureAlertAtMs + sendCronFailureAlert), across all four silent forms — addressing the production-finalizer and durable- state/alert proof gates.
|
Pushed @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing this PR as superseded by the earlier canonical fix in #120056. This branch is not safe to merge as written: Thank you @ruel225 for the useful table-driven coverage of the canonical silent-reply forms. That evidence should inform the canonical repair, but this competing implementation should not remain open. #120056 and the underlying issue #116731 remain open and are not yet land-ready. |
What Problem This Solves
Fixes #116731.
When an isolated cron agent hits an unrecoverable runtime precondition (e.g. a WSL2
/mnt/ddrvfs mount that has gone half-dead, or a missing source file) and exits with aNO_REPLYsilent reply, the cron scheduler recorded the run asstatus: ok. The silent reply token was treated as valid final assistant output, sohasRecoveringTerminalOutputbecame true, the preceding error payload was downgraded to non-fatal, andconsecutiveErrorswas cleared. As a resultfailureAlertnever fired across repeated daily failures — exactly the silent-failure class this repo ranks highest.Why This Change Was Made
Root cause is in
resolveCronPayloadOutcome(src/cron/isolated-agent/helpers.ts). Recovery from a preceding error payload was gated on:NO_REPLYis a normalized string, so it satisfied this check even though it carries no content — it is the agent's explicit decision to emit nothing. A silent reply is not evidence that an earlier error was overcome.ClawSweeper's source-level review on the issue independently confirmed this exact mechanism: "an exec failure followed by
NO_REPLYcan be recorded as a successful cron run."The canonical fix is at the producer of the recovery signal, not a downstream consumer guard. Introduce
hasRecoveringFinalAssistantText, which excludes silent replies via the canonicalisSilentReplyPayloadTextclassifier (reusingSILENT_REPLY_TOKENfromauto-reply/tokens.jsrather than hardcoding the literal). This is the same classifier cron finalization already uses for the terminal field, so the recovery predicate and the finalization classifier now agree on what counts as silent. All five call sites that previously usednormalizedFinalAssistantVisibleText !== undefinedas a recovery predicate now use the filtered form, so aNO_REPLYfinal reply can never clear a fatal error payload or synthesize a success delivery.The canonical classifier covers all four silent forms the terminal field can carry: token-only (
NO_REPLY), JSON-string ("NO_REPLY"), action-envelope ({"action":"NO_REPLY"}), and reasoning-prefixed (<thinking>…</thinking>NO_REPLY). The earlier revision used the token-onlyisSilentReplyText, which let the action-envelope and reasoning-prefixed forms slip through and recover a preceding error — the ClawSweeper P1 caught this.isSilentReplyPayloadTextcloses that gap.The existing successful-recovery paths are untouched: real final assistant text still recovers plain tool warnings and message-delivery warnings exactly as before (the classifier only matches genuine silent replies, so substantive answers remain substantive — #19537).
User Impact
Operators running cron jobs that depend on external preconditions (mounts, files, network) will now see
consecutiveErrorsincrement andfailureAlertfire when the agent silently bails on a failed precondition, instead of a perpetual greenstatus: ok. This is the default cron path — no config change needed. Behavior is unchanged for runs that produce any real final answer.Evidence
src/cron/isolated-agent.helpers.test.ts: "does not let a %s silent final reply recover a preceding error" — assertshasFatalErrorPayload === trueand that the fatal error delivery payload is preserved across all four silent forms (token-only, JSON-string, action-envelope, reasoning-prefixed) withpreferFinalAssistantVisibleText: true.isolated-agent.helpers.test.ts), confirming real final-assistant-text recovery and structured-delivery paths are unaffected.tsgotypecheck andoxfmt/oxlintclean.Inspectable real cron-path proof (committed test, runs in CI)
src/cron/service/cron-finalization-streak.test.tsis a committed integration test (selected byvitest.cron.config.ts, runs in CI) that drives the REAL production functions end to end through the REAL durable persistence + alert boundary:The
finalStatusmapping is no longer a copied ternary — this PR extractsresolveCronRunFinalStatusas the single exported production mapper from the payload outcome to the terminal run status, used at both finalization sites inrun-finalize.ts(diagnosticsfinalStatusand runstatus). The test calls that same real mapper, so the proof tracks the production finalization owner and cannot diverge from it.The test asserts, across all four silent forms (token-only, JSON-string, action-envelope, reasoning-prefixed): an error payload + the silent final reply yields
hasFatalErrorPayload === true→resolveCronRunFinalStatus === "error"→ durableconsecutiveErrors0→1 andlastRunStatus === "error"reloaded from the store, and a fired failure alert (lastFailureAlertAtMspersisted +sendCronFailureAlertcalled once). A recovering final answer (control) yields"ok", resets the streak to 0, and fires no alert. Three consecutive silent-reply failures accumulateconsecutiveErrors1→2→3 in the durable store.No mock stands in for the classifier, the finalization mapper, the persisted timer-state update, or the alert dispatch. The test proves the operator-visible recovery: a silent reply after an error no longer clears the durable streak or suppresses the fired
failureAlert.Classifier divergence (the P1 bug this fix closes)
The token-only
isSilentReplyText(used by the earlier revision) misses the action-envelope and reasoning-prefixed silent forms, so those would have recovered a preceding error and cleared the streak. The canonicalisSilentReplyPayloadText(used after this fix, and already used by cron finalization) catches all four:Production LOC: +15 / −2 in
helpers.ts+run-finalize.ts(one canonical-classifier swap with a 3-line invariant comment, plus extractingresolveCronRunFinalStatusas the single shared finalization-status mapper used at both finalization sites — removing two inline copies of the ternary). Test LOC counted separately.Competition analysis
Issue has no assignees and no linked open PRs as of this submission. ClawSweeper marked it
clawsweeper:queueable-fix/clawsweeper:source-reprobut is not implementing it.