Skip to content

fix(cron): preserve structured timeout task outcomes - #117340

Closed
steipete wants to merge 2 commits into
mainfrom
codex/qa400-cron-structured-timeout-owner
Closed

steipete wants to merge 2 commits into
mainfrom
codex/qa400-cron-structured-timeout-owner

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operators inspecting scheduled automation tasks would see trigger-evaluation or script-payload timeouts incorrectly reported as ordinary failures, even though the underlying cron run had an explicit timeout reason.

Why This Change Was Made

The cron execution owner now carries its existing structured timeout classification through one canonical task-status projector for scheduled runs, manual early finalization, normal run history, and interrupted-task recovery. Provider-style text inferred into historical diagnostics is not treated as authoritative terminal state.

User Impact

Timed-out trigger evaluations and script payloads now appear correctly as timed-out automation tasks. Ordinary failures remain failed, existing watchdog timeouts remain timed out, and operator-cancelled tasks stay cancelled when their final run history is attached.

Evidence

  • Regression-first proof against actual CronService and the real SQLite task ledger reproduced both trigger and script timeouts persisting as failed before the fix.
  • Cache-disabled production-path matrix after the fix verified five actual SQLite outcomes: trigger timeout timed_out, structured script timeout timed_out, ordinary local failure failed, legacy watchdog timeout timed_out, and operator cancellation cancelled after actual cron completion.
  • Existing focused cron suite: 20 tests passed with cache disabled (node scripts/run-vitest.mjs src/cron/service.trigger-eval.test.ts --no-cache).
  • Five independent hostile read-only reviews reported no P0–P3 issues. Genuine TruffleHog 3.96.0 scanning was clean, and gpt-5.6-sol with high reasoning reported zero actionable findings (confidence 0.90).
  • Exact immutable reviewed commit: 35f011be903801507a2b8c27a1195bf2fcb849b4. All five owner paths are unchanged on current main aa2a5c96f69a1be639c602649d4aa2e4de8da0a8, and the synthetic merge is clean. Remote CI has not been run.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 1, 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. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 2, 2026, 5:34 AM ET / 09:34 UTC (Revision 14).

ClawSweeper review

What this changes

The branch carries structured cron timeout reasons into task statuses for manual and scheduled runs and adds SQLite-backed regression coverage.

Merge readiness

⛔ Blocked before merge - 3 items remain

The task-ledger target has since been retired by merged work, so this branch no longer fits current main as written. Maintainer protection requires an explicit disposition. The previous history-import finding predates this PR and is withdrawn.

Priority: P2
Reviewed head: a86f3a12e3d1c391f4e7c33c9edfadc05152b164
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The original patch is focused and has useful reported boundary validation; architectural retirement requires disposition without establishing a new patch defect.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The protected maintainer PR is exempt from contributor proof requirements; its reported CronService/SQLite matrix covers the former ledger, while current-owner integration remains unresolved. No stored schema or serialized-format contract changes are introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The protected maintainer PR is exempt from contributor proof requirements; its reported CronService/SQLite matrix covers the former ledger, while current-owner integration remains unresolved. No stored schema or serialized-format contract changes are introduced.
Evidence reviewed 8 items Verified introduced changes: The pinned introduction delta adds producer timeout classification and forwards it into the existing task projector; it does not change the legacy importer or persisted history format.
Previous finding ownership correction: The merge-base projector already ignored persisted errorReason and classified errors solely through watchdog text. The unchanged importer calls that projector without transient classification. This PR preserves that pre-existing limitation rather than introducing it; startup recovery also reads completed ledger rows without rewriting their terminal status.
Merged architectural retirement: GitHub verifies #159179 merged on 2026-09-27. Its stated contract retires Tasks APIs and panels while retaining Cron-owned history. Local history verifies deletion of src/cron/service/task-runs.ts.
Findings None None.
Security None None.

How this fits together

Cron executes scheduled triggers and payloads, then records their outcomes for operators. This branch updates the former Tasks ledger; current main records cron history through a dedicated Cron owner.

flowchart TD
A[Scheduled or manual run] --> B[Trigger and payload execution]
B --> C[Structured outcome]
C --> D[Branch task-status projection]
D --> E[Former Tasks ledger]
C --> F[Current Cron history owner]
F --> G[Operator run history]
Loading

Decision needed

Question Recommendation
Should this protected branch be retired after Tasks removal, or adapted to a specific remaining Cron-history classification requirement? Retire the old ledger branch: Close this branch deliberately and retain current Cron diagnostics unless an observable remaining failure is established.

Why: The original operator surface is retired, while the retained history projector still distinguishes watchdog timeouts; choosing whether that remaining internal distinction warrants this work requires owner intent.

Before merge

  • Resolve merge risk (P1) - The current head conflicts with main and targets a retired ledger; its intended behavior needs an owner disposition before any conflict resolution or landing.
  • Complete next step (P2) - Choose whether to retire this branch or adapt a defined remaining requirement to the current Cron history owner; resolve conflicts only if retaining it.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +12, Tests +70. Total +82 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 4 23 11 +12
Tests 1 70 0 +70
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 93 11 +82

Review metrics

Metric Value Why it matters
Production versus regression coverage production net +12 lines; tests +70 lines Production growth carries structured classification through one projector, but that projector's owner has since been retired.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep timeout provenance within the current Cron-owned history flow, without restoring retired Tasks modules.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep timeout provenance within the current Cron-owned history flow, without restoring retired Tasks modules.

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

No current-main reproduction of the original task-panel symptom is established: Tasks has been retired, and the branch tests target its former ledger.

Is this the best way to solve the issue?

No as a landing path for current main: the producer classification is appropriate, but any retained requirement belongs in Cron-owned history rather than deleted task modules.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f8596942123f.

Labels

Label changes:

  • 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. Not applicable: The protected maintainer PR is exempt from contributor proof requirements; its reported CronService/SQLite matrix covers the former ledger, while current-owner integration remains unresolved. No stored schema or serialized-format contract changes are introduced.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Timeout classification is a bounded diagnostic correctness improvement, with no established urgent current-user regression.
  • 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. Not applicable: The protected maintainer PR is exempt from contributor proof requirements; its reported CronService/SQLite matrix covers the former ledger, while current-owner integration remains unresolved. No stored schema or serialized-format contract changes are introduced.

Evidence

What I checked:

  • Verified introduced changes: The pinned introduction delta adds producer timeout classification and forwards it into the existing task projector; it does not change the legacy importer or persisted history format. (src/cron/task-run-detail.ts:257, a86f3a12e3d1)
  • Previous finding ownership correction: The merge-base projector already ignored persisted errorReason and classified errors solely through watchdog text. The unchanged importer calls that projector without transient classification. This PR preserves that pre-existing limitation rather than introducing it; startup recovery also reads completed ledger rows without rewriting their terminal status. (src/cron/task-run-detail.ts:266, aa743c9f8186)
  • Merged architectural retirement: GitHub verifies refactor: remove Tasks and TaskFlow runtime #159179 merged on 2026-09-27. Its stated contract retires Tasks APIs and panels while retaining Cron-owned history. Local history verifies deletion of src/cron/service/task-runs.ts. (src/cron/service/task-runs.ts, 6652f7eac8d9)
  • Current replacement owner: Current main forwards classification into the Cron event codec and persists outcomes through finishCronRun. Its storage-status projector still recognizes watchdog text rather than all structured timeout reasons, so retirement is not proof that every requested classification behavior is implemented. (src/cron/service/run-history.ts:178, f8596942123f)
  • Current producer classification: Current trigger execution uses cronScriptFailureMetadata, which explicitly classifies timeout codes. This helper is also present in v2026.9.7. The original task-ledger modules are absent from that release tree. (src/cron/script-failure.ts:8, c074824a27c9)
  • Validation and continuity: The captured PR body reports a production CronService/SQLite matrix covering trigger timeout, script timeout, ordinary failure, watchdog timeout, and cancellation at 35f011b. The added tests exercise the former ledger. No tests were executed during this read-only review; those results do not establish integration with the replacement owner. (src/cron/service.trigger-eval.test.ts:234, a86f3a12e3d1)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • If the work is retained, validate the defined timeout behavior through current Cron-owned history and recovery.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-07T09:33:57.931Z sha a86f3a1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T16:13:45.137Z sha a86f3a1 :: needs maintainer review before merge. :: none
  • reviewed August 15, 2026, 5:57 PM ET / 21:57 UTC sha unknown :: found issues before merge. :: [P2] Map the persisted timeout reason in the task projector
  • reviewed 2026-08-19T04:09:10.096Z sha a86f3a1 :: found issues before merge. :: [P2] Honor persisted timeout reasons during legacy cron import
  • reviewed 2026-08-25T05:26:11.619Z sha a86f3a1 :: found issues before merge. :: [P2] Honor persisted timeout reasons during history import
  • reviewed 2026-08-25T06:07:31.323Z sha a86f3a1 :: found issues before merge. :: [P2] Persist authoritative timeout provenance for history imports
  • reviewed 2026-09-02T02:09:20.824Z sha a86f3a1 :: found issues before merge. :: [P2] Honor durable timeout provenance during legacy import
  • reviewed 2026-09-27T06:03:29.167Z sha a86f3a1 :: blocked before merge. :: [P2] Preserve producer timeout provenance during history import

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 7, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Aug 14, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 15, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Closing because #159179 removed the Tasks/TaskFlow ledger and task-status projection this PR repairs. The timeout-to-task-state change no longer has a consumer on current main.

Closed in a sweep of stale maintainer PRs (no activity for 7+ days). Reopen with a current reproduction if this still matters.

@steipete steipete closed this Oct 21, 2026
@RomneyDa
RomneyDa deleted the codex/qa400-cron-structured-timeout-owner branch October 22, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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