Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 24, 2026, 4:49 PM ET / 20:49 UTC. ClawSweeper reviewWhat this changesThis PR preserves an operator’s cancellation reason on a cron task while recording the completed execution and interrupted delivery outcome in cron history. Merge readinessKeep open: the prior P1 remains. This conflicted branch lacks current main’s completion-status contract, so an unsafe rebase could report a required delivery failure as success; the cancellation-reason repair should be rebased atop that contract. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherCron finalization writes both a generic task lifecycle record and cron-specific history detail after execution and delivery settle. A late cancellation must preserve the generic cancellation outcome while retaining the cron completion and delivery facts for history. flowchart LR
A[Cron execution] --> B[Delivery settlement]
B --> C[Completion outcome]
C --> D[Finished cron event]
D --> E[Late task finalization]
E --> F{Task already cancelled?}
F --> G[Generic task reason]
F --> H[Cron history detail]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +14. Total +22 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase the cancellation-only change onto current main, retain completionStatus authoring, persistence, and mapping, then add one combined regression for cancelled task state plus failed delivery completion in history. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main shows the completion path that the branch lacks, although no test was run in this read-only review. Is this the best way to solve the issue? No: preserving cancellation ownership is the right direction, but this stale branch is not the best complete fix until it retains current main’s completion-status pipeline and proves both outcomes together. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5775cd3dfaf4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
Superseded by #129331. The replacement preserves this PR's original author attribution, rebases the cancellation-reason repair onto current Closing this stale, conflicting source PR in favor of the takeover-ready replacement. |
Related: #117425
AI-assisted: Codex implemented and independently reviewed this repair.
What Problem This Solves
Fixes an issue where cancelling a cron task after its execution completed but while webhook delivery was still pending could leave the task marked cancelled while silently clearing the accepted operator cancellation reason. The same task row also could not represent that execution succeeded while delivery was interrupted.
Why This Change Was Made
Late cron finalization now preserves the generic task lifecycle's accepted
cancelledstatus and reason, while cron-owned detail stores the underlying execution error/summary and delivery result for history projection. Current detail wins over the unchanged released-row fallback, so this adds no config, schema, protocol, or fallback reader. PR #117425 owns admission provenance and stale-delivery policy; it has no file overlap with this terminal task/history projection repair.Production LOC: +15/-7 (net +8) to separate the two owner-native outcomes at write time; tests: +24/-10. The production growth adds the missing canonical cron detail fields and prevents cancellation finalization from overwriting generic lifecycle fields.
User Impact
Operators can trust a successful cancellation response to remain visible on the task. Cron history separately reports the completed execution and interrupted delivery, for example
status: ok, the execution summary,delivered: false, and the delivery cancellation error.Evidence
node scripts/run-vitest.mjs src/cron/service/task-runs.test.ts -t 'keeps operator cancellation reason when webhook delivery is interrupted'failed because the persisted task had noerror; expectedCancelled by operator.node scripts/run-vitest.mjs src/cron/service/task-runs.test.ts src/cron/service/timer-job-runner.interruption.test.ts src/cron/task-run-history.test.ts— 41 passed.node scripts/run-vitest.mjs src/cron/service.persists-delivered-status.test.ts src/cron/service/timer.regression.test.ts -t 'finalizes immediately when a command webhook is cancelled|cancels timeout-disabled cron task runs without waiting for the runner'— 2 passed, 83 skipped.node scripts/check-changed.mjs— passed after the rebase, including core and core-test typechecks, lint, database-first, and import-cycle guards.git diff --check origin/main...HEAD— passed.Live operator-Gateway proof was not run: reproducing the narrow post-execution/pre-webhook cancellation window requires coordinating an authenticated task cancellation with a deliberately hanging webhook. The focused owner-boundary regression captures that exact ordering, while the two existing real-flow tests independently prove accepted cancellation and hanging-webhook interruption.