Repository navigation
Conversation
Preserve unstarted timed occurrences with bounded retry deadlines, coalesce their receipts, and publish waiting reasons without overwriting the prior run outcome. Warn after five deferred attempts and preserve pending admission across restart.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis PR adds bounded backoff, receipt coalescing, and visible waiting reasons for timed automations deferred before execution. Example: A one-minute automation is due at 12:00 while its agent is busy.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR addresses a current cron retry loop through the existing worker owner, and inspection found no discrete introduced correctness defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe cron worker turns stored job schedules into fenced execution requests, persists outcomes in SQLite, and publishes runtime state through Gateway projections to Automations clients. flowchart LR
A[Stored cron jobs] --> B[Cron scheduler worker]
B --> C[Receipt queue]
C --> D[Execution admission]
D --> E[Outcome finalizer]
E --> A
E --> F[Gateway projections]
F --> G[Automations UI]
Technical reviewBest possible solution: Keep retry deadlines and receipt replacement in the existing cron worker, with clients consuming its recorded waiting state. Do we have a high-confidence way to reproduce the issue? Current-main source preserves the overdue occurrence after unstarted deferral and rearms it without a separate retry deadline; the submitted benchmark reports the resulting repeated attempts, but no target code was executed during this review. Is this the best way to solve the issue? The smallest complete repair is to retain one pending occurrence with worker-owned backoff and fresh receipt fencing, then expose that state through existing projections; the patch follows that design without a parallel scheduler or configuration knob. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4129e21215e7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +125, Tests +170, Docs +1, Other +254. Total +550 across 31 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 4, 2026, 7:22 PM ET / November 5, 2026, 00:22 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Preserve unstarted timed occurrences with bounded retry deadlines, coalesce their receipts, and publish waiting reasons without overwriting the prior run outcome. Warn after five deferred attempts and preserve pending admission across restart.
What Problem This Solves
Timed automations whose admission is deferred retry about every two seconds, churning skipped receipts while the job still looks healthy.
User Impact
Deferred jobs now show Waiting: since , with a warning after five attempts. They retry after 30 seconds, doubling to a five-minute cap, and run the pending occurrence once admission clears. Their last completed run remains unchanged. This can delay recovery by up to five minutes; no configuration or migration is required.
Why This Change Was Made
The cron worker retains the original occurrence and owns a separate retry deadline. Startup preserves that episode. Retries atomically replace the prior unstarted receipt while retaining a fresh execution fence. Completion, cancellation, or a scheduling change clears waiting. Existing runtime events and full/compact/tool projections publish the reason to clients. Stream retry ownership is unchanged.
Receipt retention already capped stored rows at 64 per job; the defect was continuous write/prune churn and missing visibility, not unbounded retained rows. No SQLite schema, cache, or host-admission handshake was added. Production grows 125 lines to implement the retry lifecycle and its read-only public/UI projections; benchmark tooling is separate.
Evidence
12218cbc4e40caddbb11f4a57b273fe0bf35f75a: scoped clean through P2, no actionable findings.pnpm check:changedpassed the runtime/UI type graphs, database ratchets, formatting, dead-code and import-cycle gates. It identified a benchmark worker-context type error and an array-search lint error in the new assertion; both were corrected and their targeted type/lint commands pass. The focusedpnpm check:changed -- scripts/perf/cron-deferred-admission-measure.tsreplay and test-line ratchet also pass.Synthetic owner benchmark, 1,000 jobs, ten modeled minutes, five serial alternating pairs:
Five A/A pairs: wall differences −8.19% to +3.33%; allocation −0.042% to +0.164%. CPU profiles show repeated cron-row decoding/SQLite reads disappearing with the eliminated attempts. The acceptance rule is fewer attempts/writes, one retained deferred receipt, lower CPU/allocation, and preservation of the original occurrence.
Reproduce each side with
node --expose-gc --import ./scripts/tsx.mjs scripts/perf/cron-deferred-admission-measure.ts --output <output.json>, adding--revision 12218cbc4e40caddbb11f4a57b273fe0bf35f75afor the baseline and--profilefor CPU profiles. Imports and fixture setup are outside measurement; each sample starts a fresh deferral episode. This measures the actual shared-cron owner on macOS/APFS, not whole-Gateway/model latency or large agent-database/btrfs performance. Agent transcripts and workspace files are outside this owner's read set; no production data was copied or live deployment touched.Hosted CI: inherited main regressions
Run 41936481448 tested merge
33512ad2ed0430bc79db8ed46d5ec28c59d62fceof this head into main943904e8c4cae76b64bf83b1b53a8c230122fb9b. The two failed shards reproduce with the same assertions on that exact main parent; their failed tests and copy producers are unchanged by this PR:checks-ui (2/3): table copy expects “Copied!” and receives “Copied” (new test introduced by fix(ui): preserve table cell boundaries when copying #192752,943904e8c4ca); offline model catalog expects “Offline” and receives “Disconnected” (copy changed by improve(ui): clarify connection and sign-in recovery #192246,dde5ab39f029). Focused parent replay: 2 failed, 26 passed, 7.17 seconds.checks-ui-e2e (2/4): device-dispatch tests retain “worker slots” and “Local” after improve(ui): clarify new session devices and workspaces #192044 (2a16e47f90a4) changed those labels to “session slots” and “This computer”. Focused parent replay: 4 failed, 9 passed, 85.03 seconds, matching CI.These are main test regressions requiring separate repair, including the newly added table-copy failure; they are not ignored noise. The cron boundary proof and affected UI tests pass. No CI rerun was requested. Landing uses the explicitly authorized, pinned-head inherited-failure route, retaining the failed CI evidence rather than claiming a green run.
PR-specific media verification waiver
The task lead explicitly waived rendered PR-image verification for this PR only on 2026-11-04. Both synthetic screenshots were inspected, uploaded, embedded, and verified byte-identical after download. Browser automation failed and Peekaboo confirmed that the Mac GUI session is locked, so rendering verification is limited by the environment. The Mac will remain locked. This waiver does not waive CI, inherited-failure attribution, final-head Codex autoreview, or native landing checks.