Repository navigation
fix(cron): show outcomes for authority-only withheld follow-ups - #203029
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 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 outcomes for withheld cron continuations that retain authority without automation metadata. Example: A continuation targeting agent:main:withheld-cron retains job-1's authority after its active marker retires, without scheduledAutomation metadata.
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 repairs a source-confirmed reporting gap, but its new diagnostic summary can incorrectly claim that failed history persistence succeeded. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe follow-up runner admits queued agent work, cron fences reject retired occurrence authority, and existing history and session-report owners record terminal outcomes. flowchart TD
A[Queued continuation] --> B[Follow-up admission]
B --> C[Cron authority fence]
C --> D[Typed refusal]
D --> E[History recorder]
D --> F[Session report writer]
E --> G[Diagnostic summary]
F --> G
Technical reviewBest possible solution: Keep the existing refusal and recording owners, but report history success only when its persistence owner confirms the write. Do we have a high-confidence way to reproduce the issue? Source establishes the authority-only continuation path and the metadata gate that suppresses its outcomes; the supplied regression reports the expected base failure, but this review executed no target code. Is this the best way to solve the issue? Carrying the existing recorder through the typed refusal is a focused repair that preserves authority and original occurrence results, provided diagnostic success reflects the history owner's actual outcome. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 346078f73f19. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +68, Tests 0, Docs +1. Total +69 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. 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, 5:01 AM ET / 10:01 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]>
) (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]>
Related: #202997
What Problem This Solves
A withheld cron follow-up still disappeared after #202997 was live. Reported metadata from release
95e9afcf2926(including mergee43daaa4045a) showsfollowup queue: input withheld; refusing replay: cron delivery owner retiredat 01:06:14 PST on November 21, with no recording-failure log, non-ok cron receipt within 45 minutes, or session transcript notice. The same refusal appeared at 22:54:55, 23:01:33, and 00:38 PST on the preceding release. The refusal had no session or job identifier.User Impact
Revoked cron continuations record a failed, not-delivered history outcome and a visible session failure report wherever those existing owners are available, including follow-ups that retain cron authority without automation metadata. The refusal log identifies the known session/job/run and successful recording paths; unavailable paths have explicit non-outcome reasons. Revoked inputs still cannot replay. No schema, store, retry, durability, retention, or restart recovery policy changes.
Why This Change Was Made
At base
b229b2664537,src/auto-reply/reply/followup-runner.ts:434consumes the revoked input, but line 460 gates both history and session recording onqueued.run.scheduledAutomation. This is the vanishing line for an authority-only continuation. Line 468 can also silently skip a fence with norecordWithheld, while line 502 requires a sourcedelivercallback for completion reporting.The uncovered shape is a background session-event follow-up carrying the original cron-fenced operator authority but no
scheduledAutomation, plus a Goal successor of that event. For example,src/agents/bash-tools.exec-notify.ts:75captures the producing operator authority,src/auto-reply/reply/session-event-context.ts:44recovers it, andsession-event-handoff.ts:525forwards it independently of automation metadata. The handoff's callback at line 633 records completion failure in its closure but does not rendercompletion.notice; a Goal successor clears that callback atgoal-continuation.ts:257. By contrast,buildTranscriptFollowupRunretainsbase.run, so a Goal directly originating from a scheduled turn retains automation metadata and was covered by #202997. The supplied production metadata cannot distinguish which event or Goal produced the refusal; this PR proves the missing shape without claiming an unavailable production identity.The cron delivery fence now carries its diagnostic recorder and job ID on its typed refusal error, preserving the existing
CronRunReceiptRevisionErrorcontract. The runner reads that error (including wrapped causes), independently records through the existing history/session-report owners, and logs explicit missing-handle/target reasons. An already-revoked authority also enters this settlement instead of silently taking the early-abort return. Recording remains best effort, with attributed failure logs and no replay. The original occurrence's result is preserved; the existing history owner records the continuation separately.Accepted edges: a removed/reset session can reject its existing report writer; the other recording path still runs. Storage failures are visible warnings, not a new retry queue. Fences without a recorder explicitly report the unavailable history path. All diagnosis and proof stayed in the worktree and repository tooling; no operational host or Gateway was contacted.
Simplify pass: retained one recording boundary and the existing outcome owners. Consolidated the queue/execution test fixtures and repeated settlement assertions without removing cases. Versus
b229b2664537after formatting: production +68 lines across three files; tests -6 infollowup-runner.test.tsand +6 inservice.restart-delivery.test.ts, net test lines 0; troubleshooting docs +1.Evidence
The extended regression drives the real follow-up runner, cron fence, history writer, and session-report owner for both retained-automation and authority-only follow-ups. It verifies failed history, the session's withheld report, and continued fencing. The runner suite also checks the explicit non-outcome when neither a receipt handle nor session target exists.
Red on
b229b2664537, before production edits:The failed expectation was the failed/not-delivered history entry; this was a behavior failure, not fixture setup. With the repair, both cases record history and a session notice:
All six follow-up runner files and direct consumers passed in four repository test shards (149.75 seconds total):
service.restart-delivery.test.ts,delivery.test.ts,session-run.test.ts,server-cron-completion.test.ts,timer-outcome-finalization.receipts.test.ts, andrun-receipt-store.test.ts. This includes #202997's regression, cancellation/removal fencing, and restart delivery behavior. Core typecheck plus targeted messaging and services-cron test typechecks passed. Touched-file lint, format, docs MDX sanity, andgit diff --checkpassed. One earlier runner attempt was invalidated because source changed during compiled-artifact use; that was rerun on unchanged inputs. Initial local type/lint findings were repaired.Final changed-file run:
pnpm test src/auto-reply/reply/followup-runner.test.ts src/cron/service.restart-delivery.test.ts --maxWorkers=1passed 32 runner tests and 11 restart-delivery tests in 55.87 seconds total. Per-file wall times were 5.87 seconds (runner; test bodies about 0.06 seconds) and 46.57 seconds (cron; test bodies about 3.5 seconds). The cron wall time includes a cold worker-artifact preparation of 33.22 seconds for the repository graph, not extra per-test work; this existing production-boundary composition exercises the real history and session writers. Exact-head CI completed successfully in 786 seconds (09:46:23–09:59:29 UTC), including broad repository gates.Local candidate and committed-head Codex autoreview against
b229b2664537, P0–P2: scoped-clean, no accepted/actionable findings. Committed review head:830fbe20db1ea2afc687bde96e273c896370c357. Native review artifacts validated with zero findings; preparation preserved that head without rebase or push.Exact-head CI run 44891154710 completed successfully.
node scripts/watch-pr-ci.mjs 203029 830fbe20db1ea2afc687bde96e273c896370c357returnedGREEN, zero pending, with 12 superseded checks distinguished from the raw GitHub rollup. No CI reruns.