Repository navigation
fix(cron): keep replies to delivered questions in the same idle session - #128845
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: needs real behavior proof before merge. What this changesRefresh destination idle freshness when a visible automation result is newly committed to its conversation. Example: A Telegram conversation has been idle for 185 minutes under a 180-minute policy when an automation asks “Approve the scheduled transaction?”
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it repairs a current session-context bug through the existing persistence owner, has maintainer engagement, and introduces no actionable code defect. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherCron delivery passes confirmed visible output to the canonical background-result writer, which atomically appends conversation history and updates session metadata consumed by inbound reply admission. flowchart LR
A[Cron result] --> B[Confirmed delivery]
B --> C[Background result writer]
C --> D[Transcript and freshness transaction]
D --> E[Inbound reply admission]
E --> F[Conversation context]
Technical reviewBest possible solution: Retain this focused repair in the canonical background-result transaction, preserving replay idempotency and daily-reset semantics. Do we have a high-confidence way to reproduce the issue? The linked report supplies an official affected release and transcript evidence, and current source confirms that delivered results omit the timestamp used for idle expiry; no reproduction was executed during this read-only review. Is this the best way to solve the issue? This is a focused root-cause repair using the existing atomic lifecycle patch, with no competing freshness writer or configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 330c27ed6342. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +89, Docs +2. Total +92 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReview history (15 earlier review cycles; latest 8 shown)
Reviewed October 15, 2026, 6:10 PM ET / 22:10 UTC (Revision 16). |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
64fc392 to
2c9d102
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Integrate current main and replace obsolete mirror-specific freshness plumbing with the canonical background-result lifecycle patch. Preserve replay semantics and cover the next operator reply without repeating the scheduled question.
Co-authored-by: Thinkr1 <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…on (openclaw#128845) * fix: renew idle freshness when cron delivery mirrors into channel session operator-facing delivery mirrors now stamp lastInteractionAt alongside updatedAt so idle reset does not cut between the cron question and reply fixes openclaw#128797 * test: use resolveSessionResetPolicy in cron mirror freshness regression * fix: scope idle refresh to direct cron delivery mirrors make touchLastInteractionAt an explicit opt-in from appendDirectCronDeliveryTranscriptMirror instead of enabling it for every appendExactAssistantMessageToSessionTranscript call; and add preservation coverage for generic assistant appends and update cron mirror expectations * test: prove cron delivery session freshness end to end * test: fix cron delivery freshness QA config * docs: document cron delivery freshness behavior * docs: clarify cron session freshness targets * test(cron): preserve delivery worker clock in freshness regression * test(cron): finalize operator reply context before session admission * test(cron): specify command authority for the operator reply --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Thinkr1 <[email protected]>
Fixes #128797
What Problem This Solves
A reply to a cron-delivered question can cross an idle reset and lose the question, even when the operator answers within minutes of delivery.
User Impact
A visible automation result newly appended to its destination conversation starts a fresh idle window. Silent runs, failed or uncertain deliveries, and retries of the same result do not refresh it. Recurring visible results can keep a destination idle-fresh; daily resets still use the session start time. No configuration or schema migration is needed.
Why This Change Was Made
Current main removed direct transcript mirrors in #168996 and now commits destination results through the canonical background-result writer. That writer still updates
updatedAt, while idle expiry readslastInteractionAt. Pass the message timestamp through its existing lifecycle patch so the guarded worker transaction commits the message and freshness together, only on a new append. This adds no parallel freshness writer or main-thread database access.Original fix by @Thinkr1; maintainer cleanup moves the repair to the current owner and removes the obsolete six-file opt-in plumbing and QA scenario. The new regression uses a bare
okfollow-up, addressing ClawSweeper's P2 finding that the old scenario repeated the question marker and could falsely report retained context. Main's current delivery, restart, and writer guards are preserved.The background commit retains the admitted config-derived store path, agent/session identity, confirmed payload, and occurrence key. Existing producer/abort checks and session ID/lifecycle checks revalidate authority at the commit; the timestamp is captured after waiting for active work and preparing display content. No new deferred work or captured limits are introduced.
Evidence
Exact-head CI run 38812272070 passed: 37 successful jobs, 28 skipped, zero failures, on
c247a03bd5eeb96df8d417e643ceb9cd32f07b00. This includes production/test typechecks, lint, build, UI checks, and the selected test shards.f6c0408505eb32d25d794557df153bdc4738a85d: the background-result commit omittedlastInteractionAt, andevaluateSessionFreshnessuses that field for idle expiry.keeps the destination session for a reply to a delivered cron questioninsrc/cron/isolated-agent/destination-completion.test.ts. It exercises cron dispatch, durable destination persistence, replay without a second freshness touch, and the next operator reply under a 180-minute idle policy. The previous human interaction is already 185 minutes old at delivery. The stored row is seeded as stale; no clock overrides, real timers, or sleeps are added.finalizeInboundContextowner. The third run passed the runtime regression and all destination/background-result tests; its test typecheck caught the missing requiredcommandAuthorizedargument, now explicitlyfalsefor this ordinary reply. These were new fixture errors, not inherited failures; no CI reruns were requested.NO_REPLY, failed/uncertain sends, session resets, and duplicate results. PR CI ran these tests throughnode --import tsx scripts/ci-run-node-test-shard.mtsand supplied the typecheck gate. On headc247a03bd5eeb96df8d417e643ceb9cd32f07b00, changed-test job 116689168044 passed all 16 destination tests and 9 background-result tests. The new regression passed in 5.322 seconds. File wrapper wall times were 75.01 seconds and 25.74 seconds, respectively (including transforms/imports and worker setup). The destination integration uses real delivery/storage/reply-admission owners; no Gateway process or local test execution was used.oxfmt, coreoxlint, andgit diff --checkpassed. The borrowed install lacks the UI-only Solid lint dependency, so the static lint config omits only UI overrides; all applicable core rules are retained. No dependency installation or shared-install changes.bc5b35fad377) reports no actionable code findings and confirms the earlier false-positive test was addressed. Its sole remaining request is live Gateway/Telegram proof; that proof-only request is intentionally not followed under the maintainer policy below. The final required-boolean fixture correction is covered by fresh autoreview and green exact-head CI.