Repository navigation
Conversation
|
🦞👀 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: blocked before merge. What this changesThis PR binds background commands and completion events to their cron occurrence and prevents automatic timeout retries after execution starts. Example: A daily automation launches background exec and reaches its execution deadline.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR contains useful cron lifetime repairs and no identified code findings; its deliberate change to timeout retry behavior still needs a maintainer decision. Priority: P1 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe cron scheduler owns occurrence cancellation and outcomes; exec consumes that lifetime when launching processes and handing completion events to the session controller. flowchart TD
A[Scheduled automation] --> B[Cron occurrence owner]
B --> C[Agent execution]
C --> D[Background exec process]
D --> E[Session completion queue]
B --> F[Cancellation lifetime]
F --> D
F --> E
B --> G[Outcome and retry scheduling]
Technical reviewBest possible solution: Land the occurrence-lifetime repair with existing retry behavior unless the cron owner explicitly approves the proposed timeout policy. Do we have a high-confidence way to reproduce the issue? Current-main exec ownership lacks the occurrence cancellation lifetime added here; source tracing and the supplied Gateway trace establish the path, while this read-only review executed no target code. Is this the best way to solve the issue? Reusing the active-job marker, exec cancellation owner, and session controller is a focused solution; suppressing timeout retries is a separate policy choice rather than a necessary consequence of cancellation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3bbc9cc5a329. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +134, Tests +722, Docs +2. Total +858 across 18 files. Added test files: 3. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
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 HistoryReviewed October 22, 2026, 1:39 PM ET / 17:39 UTC (Revision 3). |
|
Fixed successful-teardown cancellation and superseded-occurrence revival in a0b68f6. Updated evidence includes red/green real-queue regressions, 67 affected tests, targeted static checks, and a shipped-CLI model-launched exec trace: zero late work after timeout and one successful completion follow-up. Retry-policy acceptance remains an explicit maintainer decision; this PR remains a draft. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Integrated upstream to resolve the exec-settlement conflict and updated the retry documentation. Current proof: 95 affected tests, core types, targeted lint/format, documentation sanity, runtime build, and the shipped-CLI background completion trace pass. Fresh candidate and published 2026.10.6 -> candidate state-upgrade checks preserve existing job settings/history; scheduled started timeouts do not replay, and restart preserves terminal outcomes and exact next-run times. The expected one-shot auto-disable notice is attributed separately from job requests. This is manual runtime/state upgrade proof, not updater-driver qualification. Retry-policy acceptance remains an upstream maintainer decision. Kept as a draft. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Closing this draft because #189469 settled the retry behavior: timed-out jobs remain eligible for retry after the original execution settles. #138499 still tracks whether a cron timeout should terminate an explicitly backgrounded command. For a future fix, the paired Gateway regression checked both outcomes: timeout stopped the child with no late model turn, and success delivered the accepted exec completion exactly once. |
Related: #176511, #143355, #137274.
What Problem This Solves
Fixes additional model turns and repeated work when a scheduled job times out after launching background commands.
User Impact
Timeout, cancellation, and restart revoke the originating occurrence's background work and completion events. Retained process output remains inspectable. Already accepted exec follow-ups survive normal successful teardown, preserving the contract from #176511 and ordinary interactive completion behavior.
Maintainer decision still required: scheduler and native-command deadlines do not automatically replay a job after execution starts or a dispatched command's outcome remains unknown. Recurring jobs keep normal cadence; one-shots follow existing terminal-failure handling. Known pre-execution failures and provider transient retry classification retain recovery. This intentionally differs from the policy discussed in #137274; this PR remains a draft.
Why This Change Was Made
Use the existing active-job marker to capture one occurrence's cancellation lifetime beyond its first model invocation. Successful retirement transfers accepted follow-ups to the session controller without cancelling them; timeout/cancellation/generation changes still revoke the captured lifetime. A superseded occurrence cannot regain authority when its older cleanup runs.
Originating-run liveness is still checked until event acceptance. Current destination and policy checks remain active afterward. Existing occurrence admission and completion source-run attribution are preserved. #143355 covers complementary child timeout propagation.
No public API, configuration, dependency, or schema changes. Upstream integration removes its retired conversation-origin field while preserving both notification-lifetime cleanup fields. The retry documentation now distinguishes scheduled execution deadlines from provider failures and forced manual runs.
Evidence
The success trace holds the source response until the child completes and notification admission has time to finish; the third provider request must contain both the exec-completion notice and the child's output. The real queue regression separately proves explicit successful marker teardown before follow-up execution. An initial delivery:none fixture intentionally disabled wakes; a second fixture released the source before asynchronous acceptance. Those failed fixtures were diagnosed and retained, not reported as passes.
Fresh-install and latest-stable state compatibility: Separate foreground Gateways exercised both a fresh candidate and published
2026.10.6followed by the candidate's documented manual runtime replacement (doctor --fix, then restart with the same isolated state). Existing one-shot/recurring settings and full successful run history were preserved. Actual scheduled model-started timeouts disabled the one-shot and advanced the daily recurring job to its normal future occurrence. Restart preserved those terminal histories, enablement, and exact next scheduled time, with zero new provider requests. Each lane made four job requests (two successes, two timeouts) and one separately identified, expected main-session auto-disable notice. This is runtime/state compatibility proof, not a published updater-driver activation test or qualification of every historical schema.The private compatibility fixture first used forced manual runs, which intentionally preserve future slots; it was corrected to use real scheduled firing. An extra request was traced to the exact synthetic auto-disable notice, not counted as a job replay. The final proof rejects unexpected requests and checks persisted next-run times so a delayed replay cannot pass unnoticed.
CI: The complete GitHub CI run passed on
a0b68f6(run); the review of that head reported no code findings. That is prior-head evidence. This integrated head must receive its own CI/review results; draft status is preserved, so some lanes may skip. A separate aggregate status was pending when inspected. Earlier inherited local planner/root-budget and UI-suppression failures remain recorded as historical gaps, not current-head passing claims; no baselines were weakened.Local test cost
The current six-file affected run passed 95 tests in 100.76 seconds with one worker across three shards, including compiled-subprocess preparation, real child processes, controller custody, and scheduler/native-command deadline handling. The earlier four-file repair run passed 67 tests in 63.60 seconds.
Merge Danger
Door: two-way. Blast radius: cron-owned child processes, completion admission, and deadline retry scheduling. Keep draft until maintainers accept the retry policy and required review/CI gates are satisfied.