Repository navigation
fix(cron): let the agent stay silent after a posted automation notice - #207315
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: passed. What this changesThis PR lets an agent remain silent after an automation notice has already been posted and explains that notice’s status in the hidden repair input. Example: The “Health check” automation is auto-disabled and its notice reaches the owner conversation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a current cron notice defect with a focused change; no introduced correctness bug was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway cron adapter receives scheduler notices, posts them through the session notice writer, and submits a requester-bound repair turn to the conversation runtime. flowchart TD
A[Scheduler notice] --> B[Cron target resolver]
B --> C[Session notice writer]
C --> D[Conversation and channel]
B --> E[Hidden repair turn]
E --> F[Optional reply settlement]
F --> D
Technical reviewBest possible solution: Keep optional reply policy and the already-posted notice instructions together in the existing cron target resolver. Do we have a high-confidence way to reproduce the issue? Current main posts the notice but omits the host-owned optional-reply setting; existing settlement coverage establishes that an otherwise identical NO_REPLY turn fails without that waiver. Is this the best way to solve the issue? The patch fixes the producer’s missing reply policy through an existing contract, preserves requester admission and posting-failure behavior, and adds a distinct regression covering the cron producer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 685fad85e4b8. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +20, Tests +117. Total +137 across 2 files. Added test files: 1. 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 28, 2026, 2:24 AM ET / 07:24 UTC. |
|
Landed as 2a3bf24, no overrides. After a posted automation notice, the agent's repair turn may now stay silent and is told the notice is already shown. Before: NO_REPLY was refused and the agent was forced into filler after the notice. After: one silent completion (test red on the merge base, green here); on a real Telegram DM the notice arrived once, followed by one repair line that did not repeat it. CI green on d4e420d; local ClawSweeper on the exact head: correct, no findings. |
…openclaw#207315) ## Problem Since openclaw#207226, a cron job notice (auto-disabled, or a fallback failure alert) is posted to the owner conversation directly. Its model turn stays as the agent's hidden repair input. That turn still required a visible result, and its input was the bare notice text: - When the agent correctly decided it had nothing to add and answered `NO_REPLY`, the runtime refused that ("NO_REPLY is not allowed") and forced another answer. The user got filler after the notice. On a working conversation the forced replies were "I'm here—what would you like me to call you?", "Got it." and "Noted.". - Nothing told the agent that the user had already seen the notice. Found in the owed end-to-end check of openclaw#207226 on a real Telegram DM, with an isolated Gateway and `gpt-5.4-mini`. ## Fix `src/gateway/server-cron-targets.ts`, the notice owner. When the notice was posted: - The repair turn's hidden input says the notice is already shown to the user, with what they need to do, and must not be repeated. The agent either fixes the cause itself and says what it changed, or answers `NO_REPLY`. It leaves a disabled automation disabled unless it fixed the cause. The notice text is passed as an untrusted data block, like the existing repair brief. - The turn sets `replyExpectation: "optional"`, the host-owned waiver the scheduler's repair request already uses. When the notice could not be posted, the turn keeps its visible input and behavior, as before. ## What users see - After an automation notice, the agent stays silent unless it actually changed something. Before, it was forced to send filler. ## Evidence - `src/gateway/server-cron-notice-repair-silence.test.ts` runs the real cron target resolver, admission and CLI-runner settlement, with the agent answering `NO_REPLY`. - On the merge base the turn fails ("The AI service returned an empty response"). - On this branch it completes in one model call, and chat shows only the posted notice. - Real Telegram run on this head (isolated Gateway, real `gpt-5.4-mini`, an automation auto-disabled because its account was signed out): the notice arrived once, then one agent line about its repair. The notice was not repeated. - Cron notice, failure-repair final-effect, notification and failure-alert suites pass. ## Not in this PR (recorded separately) - When the notice post's channel send is refused transiently (`SESSION_DELIVERY_GENERATION_UNAVAILABLE` while the run's own result row is being written to the same session), `postSessionNotice` reports failure. Delivery recovery then sends the notice a few seconds later. The visible fallback turn runs meanwhile, so its reply can arrive before the notice. Seen once in three real runs. Co-authored-by: Ayaan Zaidi <[email protected]>
…input (#207226) ## Problem #207186 fixed the case where a cron job notice (auto-disabled, or a fallback failure alert) was lost because the owner conversation's model could not run. The notice still reached chat only as a model turn's input, and was posted directly only after that turn failed before start. A turn cancelled before start (supersession, restart) still lost it. The notice also never reached the conversation's channel as written; there the user saw only the agent's reply about it. ## Fix `src/gateway/server-cron-targets.ts` posts every job notice directly through the session notice writer (`postSessionNotice`), without a model turn. The post needs no requester: it is fixed runtime text sent to the job owner conversation. It writes one chat row and a durable send to the conversation's channel, unless the notice is private or the conversation denies automatic sends (`session.sendPolicy`). The notice's turn stays as the agent's repair turn (#188105), with its input hidden from chat (`cron_failure_repair` provenance, the same authority path as `cron`). Its error payloads are suppressed, as for repair turns, because the user already has the notice. When there is no session to post into yet, the turn keeps its visible input, so the notice still shows exactly once. The posted row is not replayed to the model, so when the repair turn fails for good before it starts (the owner conversation's model cannot run), the text is queued as context for the next turn, as #207186 did. The #207186 settle-time fallback is removed. ## What users see - Chat: the fixed notice as a system notice row, then the agent's reply when the model works. Before, it was shown as a user-role row. - Channels: the fixed notice, then the agent's reply. Before, only the reply. - A dead model: the notice still shows once. - Session notices (plugin notices too) now honor `session.sendPolicy`: a conversation that denies automatic sends keeps the notice in its transcript only. Before, `postSessionNotice` sent to the channel regardless. ## Accepted edge cases - Owner guidance typed into a notice's repair turn does not join it as owner continuation. Repair turns already work this way. ## Evidence - `server-cron-notice-delivery.test.ts`: owner model with no usable account. Chat shows the notice exactly once, as the posted assistant row. The next turn gets the notice as context. - `server-cron-failure-repair.final-effect.test.ts`, auto-disabled case with a working model: the repair still applies and chat shows the notice exactly once, as the posted row, not the turn input. - `runtime-session-notice.e2e.test.ts`: a conversation with `sendPolicy: deny` gets the transcript row and no channel send. - `pnpm check:madge-import-cycles`: 0 cycles. The send policy is loaded lazily on the delivery path, because its owner reaches the channel plugin registry, which loads the notice writer. - Not covered by a test: the private branch (`deliver: false`, one expression) and the channel send itself. - Cron failure-alert, delivery-outcome, startup-notification and Gateway notification suites pass. Co-authored-by: Ayaan Zaidi <[email protected]> Follow-up scan: 494561c test: fix the participation admission test after cron notices became repair turns (#207414); 2a3bf24 fix(cron): let the agent stay silent after a posted automation notice (#207315). Other hits are not required by this focused beta.2 fix. (cherry picked from commit fff3e0e) Release adaptation: Backport direct posting onto the beta.2 cron target, preserving the admitted session generation and no-delivery policy. Release adaptation: Resolve the lane-5 #207186 overlap in upstream order: replace the settle-time visible fallback with a direct post and hidden repair input, preserve next-turn context on permanent pre-start failure, and keep the release target-generation and delivery checks. The notice regression now checks chat projection and queued context; the separate removal, quota-alert and script-delivery fixes remain intact. Co-authored-by: RomneyDa <[email protected]>
Problem
Since #207226, a cron job notice (auto-disabled, or a fallback failure alert) is posted to the owner conversation directly. Its model turn stays as the agent's hidden repair input. That turn still required a visible result, and its input was the bare notice text:
NO_REPLY, the runtime refused that ("NO_REPLY is not allowed") and forced another answer. The user got filler after the notice. On a working conversation the forced replies were "I'm here—what would you like me to call you?", "Got it." and "Noted.".Found in the owed end-to-end check of #207226 on a real Telegram DM, with an isolated Gateway and
gpt-5.4-mini.Fix
src/gateway/server-cron-targets.ts, the notice owner. When the notice was posted:NO_REPLY. It leaves a disabled automation disabled unless it fixed the cause. The notice text is passed as an untrusted data block, like the existing repair brief.replyExpectation: "optional", the host-owned waiver the scheduler's repair request already uses.When the notice could not be posted, the turn keeps its visible input and behavior, as before.
What users see
Evidence
src/gateway/server-cron-notice-repair-silence.test.tsruns the real cron target resolver, admission and CLI-runner settlement, with the agent answeringNO_REPLY.gpt-5.4-mini, an automation auto-disabled because its account was signed out): the notice arrived once, then one agent line about its repair. The notice was not repeated.Not in this PR (recorded separately)
SESSION_DELIVERY_GENERATION_UNAVAILABLEwhile the run's own result row is being written to the same session),postSessionNoticereports failure. Delivery recovery then sends the notice a few seconds later. The visible fallback turn runs meanwhile, so its reply can arrive before the notice. Seen once in three real runs.