fix: preserve cron delivery awareness for target sessions#93580
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 20, 2026, 3:08 PM ET / 19:08 UTC. Summary PR surface: Source +144, Tests +405, Other +10. Total +559 across 19 files. Reproducibility: yes. Current main source queues cron awareness only to the main awareness session, and the supplied before Telegram screenshot shows delivered cron/message-tool content followed by a target-chat reply that lacks the code. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this head after maintainers accept the target-session awareness semantics and exact-head checks complete, while leaving the broader proactive-message context contract tracked separately. Do we have a high-confidence way to reproduce the issue? Yes. Current main source queues cron awareness only to the main awareness session, and the supplied before Telegram screenshot shows delivered cron/message-tool content followed by a target-chat reply that lacks the code. Is this the best way to solve the issue? Yes. Reusing the existing outbound session resolver plus ephemeral system-event queue is narrower than persisting cron metadata, scraping channel history, or changing user-visible delivery payloads. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 52e01676be23. Label changesLabel justifications:
Evidence reviewedPR surface: Source +144, Tests +405, Other +10. Total +559 across 19 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
c7af848 to
77ea719
Compare
|
Follow-up after running ClawSweeper CLAWSWEEPER_CODEX_LOGIN_METHOD=chatgpt pnpm local-review -- --target-dir /Users/scotthuang/github/openclaw --target-repo openclaw/openclaw --base origin/mainReview rounds addressed:
Latest local validation:
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
77ea719 to
92cea99
Compare
92cea99 to
abb1bf0
Compare
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review |
3 similar comments
|
@clawsweeper review |
|
@clawsweeper review |
|
@clawsweeper review |
Mantis Telegram Desktop ProofSummary: Mantis captured Telegram Desktop before/after GIFs, but this PR still replied without the scheduled delivery context.
Motion-trimmed clips: Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-93580/run-27645673620-1/index.json |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
94ae827 to
63e3faa
Compare
|
Merged via squash.
Thanks @scotthuang! |




Summary
Linked context
Closes: N/A
Related:
Was this requested by a maintainer or owner?
Yes. This was requested from a local maintainer workflow after observing that cron deliveries reached a channel but did not enter that channel's next-turn context.
Real behavior proof (required for external PRs)
Harness proof logs
Codex harness, message-tool delivery path:
Pi-style/openai-completions harness, direct delivery path:
Additional Codex direct-delivery check:
Telegram live before/after proof
Maintainer live-tested Telegram DM delivery against the published npm baseline and this PR using the same local state/config and the same Telegram DM target. These screenshots are intentionally left as upload slots so the maintainer can attach the private Telegram captures directly in GitHub.
Before fix, npm release
openclaw@2026.6.8/ Gateway2026.6.8 (844f405)delivered the Telegram cron message but the next Telegram turn did not know what had just been delivered.After fix, PR build
05df61064ca4ea1f0efa7ace6022b70c5628f99bdelivered the Telegram cron/message-tool content and the next Telegram turn could answer with the exact delivered code.Telegram regression check:
NPM_CRON_PR93580_TELEGRAM_20260620_0550,deliveryStatus: delivered,fallbackUsed: true.NPM_MESSAGE_TOOL_PR93580_TELEGRAM_20260620_0553,messageToolSentTo: telegram:8941550703,fallbackUsed: false,delivered: true.Commands used for the published npm baseline:
Tests and validation
Which commands did you run?
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts- passed, 77 tests.OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/cron/isolated-agent/run.message-tool-policy.test.ts- passed, 52 tests.git diff --check- passed.pnpm build- passed..agents/skills/autoreview/scripts/autoreview --mode local- final run clean: no accepted/actionable findings,overall: patch is correct (0.82).CLAWSWEEPER_CODEX_LOGIN_METHOD=chatgpt pnpm local-review -- --target-dir <openclaw checkout> --target-repo openclaw/openclaw --base origin/main- final run clean onda94c9cf902fff9df45b8ee3b8b3d7154079311e:result: nothing_found,check_conclusion: success.What regression coverage was added or updated?
What failed before this fix, if known?
If no test was added, why not?
Tests were added/updated.
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. The next agent turn in a cron delivery target can now see the delivered message or delivery failure as system-event context. The outbound channel message content itself is unchanged.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
Session targeting for awareness events, especially threaded deliveries, duplicate main-session/target-session awareness, explicit off-plan message-tool sends, and non-text message-tool deliveries.
How is that risk mitigated?
The patch reuses existing outbound session route resolution, transcript mirror projection, and idempotency keys; queues target awareness only after successful non-best-effort delivery or explicit target-aware failure handling; avoids duplicate target queueing when direct fallback already queues main-session awareness; does not add cron metadata to user-visible channel payloads; and adds focused regression tests for direct, session-bound, message-tool, off-plan explicit message-tool, same-session, media-only, failure, and threaded implicit-thread cases.
Current review state
What is the next action?
Maintainer review and CI.
What is still waiting on author, maintainer, CI, or external proof?
CI is pending. Live Weixin proof was completed locally by the maintainer across Codex and Pi-style/openai-completions harness paths.
Which bot or reviewer comments were addressed?
Local autoreview found one P1 issue around explicit off-plan message-tool target resolution; this PR fixes it by avoiding scheduled-target account/thread fallback for unverified off-plan sends and adds a regression test. The final local ClawSweeper review found nothing.