Repository navigation
fix: retain best-effort cron context for follow-up replies - #130551
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 29, 2026, 11:37 AM ET / 15:37 UTC. ClawSweeper reviewWhat this changesThe branch tags successful best-effort isolated Cron delivery mirrors and restores that tagged text to a later Telegram reply only when no live chat window remains. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain Keep open. The production change is a coherent, narrowly gated repair with no concrete correctness finding, but its supplied live Telegram evidence names older head 4d2d7de rather than the current e6cfe75 source identity, so current-head behavior proof remains required before merge. Priority: P2 Review scores
Verification
How this fits togetherCron delivery sends scheduled output to a channel session, and the next inbound channel reply assembles transcript and live-window context before reaching the model. This change gives the durable transcript a narrowly scoped fallback when the live Telegram window was lost during a Gateway restart. flowchart LR
Cron[Scheduled Cron delivery] --> Mirror[Session transcript mirror]
Mirror --> Marker[Best-effort context marker]
Reply[Inbound Telegram reply] --> Window{Live chat window?}
Window -->|yes| Live[Use live chat context]
Window -->|no| Reader[Read marked transcript context]
Reader --> Model[Follow-up model request]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +90, Other +7. Total +118 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the producer-owned marker and the default-closed, no-live-window reader predicate, then establish the same Telegram restart-and-terse-reply result on the current head. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: an explicit best-effort isolated Cron delivery writes a transcript-only mirror, current main filters it, and a post-restart Telegram reply has no live window. This read-only review did not execute the contributor branch. Is this the best way to solve the issue? Yes. Reusing the existing durable delivery mirror with a closed marker and a no-live-window reader is narrower than a new store or broad replay of proactive messages. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6475e098a014. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
17ece9b to
4d2d7de
Compare
4d2d7de to
e6cfe75
Compare
|
Thanks @AyitLabs! Proof: A real Telegram Test Server flow delivered a best-effort isolated Cron result, restarted the Gateway, and sent a terse follow-up. Current main passed zero scheduled-result copies to the provider, while this exact head passed exactly one copy.
Example
|
Best-effort isolated Cron delivery mirrors now remain available as bounded fallback context after a Gateway restart removes the live chat window. Normal transcript artifacts stay filtered, strict delivery awareness remains separate, and the fallback activates only when no live window survives. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #88757
What Problem This Solves
Fixes an issue where an operator's terse reply to a successful best-effort isolated Cron announcement could reach the model without the announcement after a Gateway restart.
For example, a scheduled check-in can ask for the operator's current weight. If the operator replies only “200 pounds,” the model needs the delivered check-in to understand what the number means.
This is the best-effort persistence slice of the broader proactive-message context problem. It does not change command Cron or every cross-session message path.
Root Cause
Successful direct Cron delivery already writes an idempotent mirror to the destination session transcript. Normal provider context correctly filters those OpenClaw-authored mirrors.
Required delivery also queues short-lived target awareness. Best-effort delivery does not. After a restart removes the live Telegram chat window, neither source carries the scheduled message into the next ordinary reply.
Why This Change Was Made
The repair marks a successful direct Cron mirror only when no required target-awareness event owns that context. The transcript reader keeps the marker filtered by default and admits it only when an inbound channel asks for a chat window but has no live window.
Strict delivery, explicit reply context, message-tool delivery, current-session completion, failed delivery, partial delivery, reset fencing, and cleanup keep their existing paths.
The Telegram proof runner now accepts
bestEffort: trueon its Cron scenario action. This keeps the live regression replayable without selecting a credential or bypassing the Convex lease pool.User Impact
After a successful best-effort isolated Cron announcement, the next ordinary reply can see the delivered content exactly once after a Gateway restart.
No config, environment variable, SQLite schema, migration, database version, public plugin API, or user-facing command changes.
Evidence
b30cef73edae8daec41c0ba36bfbe24f02701325delivered the scheduled result, restarted the Gateway, and processed the terse follow-up with0scheduled-result copies in the provider request.e6cfe7587123ab9338f1671de4fc36290b5c3d49ran the same flow with exactly1scheduled-result copy in the follow-up provider request.65/65, Cron delivery164/164, focused channel context2/2, and Telegram scenario parser5/5passed.+44/-23(net+21), unit tests+86, and Telegram harness+14/-3. The production growth carries the producer marker, default-closed selective reader, and no-live-window consumer together.Proof limitations:
Review Follow-up
11bf3cb3d099f8a1b5db3d209b339375aef9f34dand current main1ab7b7533318a264be37d29dae33d7bb3aff92b0.Sanitized Exact-Head Trace
{ "head": "e6cfe7587123ab9338f1671de4fc36290b5c3d49", "cron": { "status": "completed", "runStatus": "ok", "cleanup": "removed" }, "gatewayRestart": "completed", "recordingComplete": true, "distinctTelegramMessageCount": 2, "scheduledResultCopiesInFollowupProviderRequest": 1, "verdictSha256": "42138ef9c5f787cacd3800f1f06a120a7eef02f13456655b00515acb2469c9ee" }The equivalent current-main trace recorded
scheduledResultCopiesInFollowupProviderRequest: 0.AI-assisted development disclosure: the implementation and tests were produced with Codex assistance under human direction and validated through the evidence above.