Repository navigation
fix(cron): show outcomes for withheld follow-ups - #202997
Conversation
Retain the delivery fence while recording refused cron continuations in existing run history and bounded session failure notices. Preserve the original occurrence outcome and never replay revoked input.
|
🦞👀 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 Summary: ✅ CompletedThis 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: needs changes before merge. What this changesThis PR records withheld cron follow-ups in cron history and the targeted session without replaying their inputs. Example: A cron Goal continuation targets agent:main:withheld-cron after its active-run marker has been cleared.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it addresses a source-confirmed gap in withheld cron follow-up reporting, but the new notice needs actionable wording before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe follow-up runner admits queued agent work; cron supplies occurrence authority, while existing cron-history and session-transcript writers persist terminal outcomes. flowchart TD
A[Cron occurrence] --> B[Queued follow-up]
B --> C[Admission fence]
C --> D[Refused continuation]
D --> E[Cron history writer]
D --> F[Session failure writer]
Technical reviewBest possible solution: Keep the existing refusal and persistence owners, and give the session notice a plain explanation and a safe next action. Do we have a high-confidence way to reproduce the issue? Source confirms that recorded authority loss consumes the queued continuation while notification depends on a callback detached Goal continuations lack; the supplied regression exercises that path, but this review ran no target code. Is this the best way to solve the issue? The patch uses the smallest existing ownership path for recording refusal outcomes and preserves delivery authority, with one actionable-copy defect. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 76cbbdf70d30. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +76, Tests -1. Total +75 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel 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 Reviewed November 21, 2026, 3:07 AM ET / 08:07 UTC. |
|
Merged via squash.
|
- status-message: the fork moved formatVoiceModeLine out (line cap) and upstream openclaw#203043 moved formatEstimatedContextBudgetTokens out; together they took the last reader of the SessionEntry type import (TS6133). - followup-runner.test: upstream openclaw#202997/openclaw#203029 replaced the createSettledExecution fixture with createExecution("settled" default); the fork's suppressed-delivery ordering case follows (TS2552). No behavior change. Refs openclaw#129388 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…202997) Retain the delivery fence while recording refused cron continuations in existing run history and bounded session failure notices. Preserve the original occurrence outcome and never replay revoked input.
) (cherry picked from commit f02d9dc) Release adaptation: Place the captured cron receipt/error contract and troubleshooting text first. Its producer and consumer follow in the paired source commit. Companion audit: #203029 is required by #202997 to cover authority-only refusal without replay. Co-authored-by: RomneyDa <[email protected]>
Retain the delivery fence while recording refused cron continuations in existing run history and bounded session failure notices. Preserve the original occurrence outcome and never replay revoked input. (cherry picked from commit e43daaa) Release adaptation: Integrate the companion against the stable pre-source queue/cron owners; keep their activated behavior in this source commit after the companion contract. No change to authority or replay policy. Companion audit: #203029 included as the preceding contract and paired activation; later account/restart lifecycle rows are independent. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Two cron-originated follow-ups were withheld with
followup queue: input withheld; refusing replay: cron delivery owner retired, with no matching delivery or notice afterward. The reported restart was at 22:44:44 PST; the refusals were at 22:54:55 and 23:01:33 PST. The refusal line contained neither a session key nor a job ID.User Impact
A withheld cron follow-up now records a failed, not-delivered outcome in the existing cron run history and a bounded failure notice in its targeted session. Removed jobs, cancellations, deleted agents, and retired delivery owners still cannot replay their inputs. No schema, store, queue, restart recovery, or durability policy changes.
Why This Change Was Made
At base
f01c0ed4ecde,src/cron/service/delivery-attempt-fence.ts:41-48combines generation retirement without handover, a stale active-run marker, cancellation, job removal, and a changed default agent into the same error. The metadata cannot identify which production condition fired. A hard process restart cannot retain the in-memory follow-up object or its closures; durable cron recovery is a separate owner. Existing reload handover explicitly preserves delivery authority for live runs. This PR does not claim a false restart fence or change handover.The regression demonstrates the stale active-run marker condition (
!isCronActiveJobMarkerCurrent(activeJobMarker), base line 42). Normal cron finalization clears that marker (src/cron/service/timer-outcome-finalization.ts:231). A detached internal-event Goal continuation retains its cron authority but clearsqueuedFollowupReplyDisposition(src/auto-reply/reply/goal-continuation.ts:257). Ordinary session-event follow-ups do have adelivercallback, but that callback records a failed completion in its closure and does not rendercompletion.notice(src/auto-reply/reply/session-event-handoff.ts:633).The vanishing boundary is
src/auto-reply/reply/followup-runner.ts:427: the refusal becomesconsumed; notification requiressourceDisposition?.kind === "deliver"at line 457, then line 507 completes the queued input's lifecycle. The new diagnostic settlement runs independently of that callback. The captured cron receipt owner writes a separate, idempotently keyed history outcome for the refused continuation, preserving the original occurrence's outcome. The existing session failure-report owner appends the notice without executing the input.Accepted edges: a removed/reset session can refuse a transcript write through its existing writer guard; cron history remains the outcome owner. Storage failures retain the existing best-effort warning behavior. There is no replay or new retry mechanism. The supplied metadata cannot establish the two production fence conditions; diagnosis and proof stayed local, with no live Gateway or host access.
Simplification: consolidated repeated follow-up delivery/refusal setup while preserving all distinct cases and assertions, and removed a single-use fixture helper with an unused override seam. Production grows by 76 lines across four files; tests change by -1 line across two files versus the base after formatting.
Evidence
The regression drives the production follow-up runner, real cron fence, cron history writer, and session transcript report owner. It retires the active marker before admission; the input remains fenced and its reason is recorded in history and the session.
Red on
f01c0ed4ecde, before production edits:The failed assertion expected a failed, not-delivered history entry with
error: "cron delivery owner retired"and the targeted session key. Initial test setup failures were corrected before recording this behavioral red.Green: all six existing follow-up runner test files passed (46 tests: 2 in the writer-claim shard and 44 in the auto-reply shard). The cron regression, session-run, receipt-finalization, and receipt-store files passed. The delivery-fence consumer run passed: 21 Gateway completion tests (including removed/cancelled occurrence fencing), plus 24 cron delivery/restart tests. Core and targeted messaging/cron test typechecks, touched-file lint, format, and
git diff --checkpassed. Local Codex autoreview of the complete candidate againstf01c0ed4ecde, P0–P2: scoped-clean, no accepted/actionable findings. Committed PR heada20cb56a5c070422e8c8dabf9f95dc7cdf6657d8also passed Codex autoreview againstf01c0ed4ecde, P0–P2: scoped-clean, no accepted/actionable findings. Exact-head CI is being watched with the repository watcher.Additional direct consumers passed:
src/cron/session-run.test.ts,src/cron/service/timer-outcome-finalization.receipts.test.ts, andsrc/cron/store/run-receipt-store.test.ts.