Repository navigation
refactor(automations): retire heartbeat SDK and scheduling entry points - #180106
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2ae0784e6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review The branch and migration notes are current at 63f7c3c. The inline exec-result race is fixed with a red/green NodeRegistry regression; stale Cron fixtures and executor-only tests are migrated to the ordinary owners. Focused proof and the fresh P2 review pass. Exact-head CI is running. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR removes heartbeat SDK and scheduling entry points and routes remaining node notices through ordinary session events. Example: A migrated inbox task runs every 30 minutes.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 5 items remain Keep open: this maintainer-approved retirement remains necessary, but the formatter change leaves three confirmed consumer-test failures. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherCron schedules persisted jobs, while node producers submit immediate notices; both hand execution and delivery to the existing session controller. flowchart LR
A[Legacy configuration] --> B[Doctor migration]
B --> C[Automation jobs]
C --> D[Cron scheduler]
D --> F[Session controller]
E[Node notices] --> F
F --> G[Conversation delivery]
Technical reviewBest possible solution: Complete the approved retirement using the existing session controller, migrate the formatter’s remaining consumer tests, and retain Doctor as the sole legacy decoder. Do we have a high-confidence way to reproduce the issue? Exact-head CI reproduces three formatter consumer-test failures, and source inspection directly connects them to removal of the exec-event exclusion; no target code was run during this review. Is this the best way to solve the issue? The existing session controller is the appropriate replacement owner, and the schedule and identity helpers move to Doctor without introducing another scheduler or state owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ae30072d1ca. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: The node handoff retains source checks, but final-effect authority coverage is not established. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel 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 Reviewed October 21, 2026, 9:41 PM ET / October 22, 2026, 01:41 UTC. |
|
Merged via squash.
|
…ts (openclaw#180106) * refactor(automations): retire heartbeat SDK and scheduling entry points * docs: refresh worker inventory after main integration * fix(automations): preserve ordinary exec completion custody * fix(automations): retain delivery-held event custody
… SDK export (#192760) Core no longer exports HEARTBEAT_RESPONSE_TOOL_NAME from plugin-sdk/agent-harness-runtime (#180106), but @openclaw/codex 2026.9.7 to 2026.10.10 still import it, so a left-behind runtime passed the 2026.9.7 floor and failed every Codex turn with a SyntaxError. Raise the floor to 2026.11.5-beta.1, the first runtime without the import, so admission refuses it with update repair guidance instead.
… SDK export (openclaw#192760) Core no longer exports HEARTBEAT_RESPONSE_TOOL_NAME from plugin-sdk/agent-harness-runtime (openclaw#180106), but @openclaw/codex 2026.9.7 to 2026.10.10 still import it, so a left-behind runtime passed the 2026.9.7 floor and failed every Codex turn with a SyntaxError. Raise the floor to 2026.11.5-beta.1, the first runtime without the import, so admission refuses it with update repair guidance instead.
…paid model (#200741) Root cause: src/gateway/server-node-events-notifications.ts:128 admits phone notifications through `enqueueSessionEventForHost` without the producer's `replyExpectation: "optional"`, so in a WebChat session the `internal_system` turn resolves as result-required (src/agents/reply-completion.ts:116-122) and the CLI runner rejects an authored `NO_REPLY` as `empty_response`, which starts model fallback. Fixes #200710 Thanks @dawidkulpa for the report with exact before/after counts, and @vaibhav375 for the fix. ## What Problem This Solves Since 2026.11.5, when an agent decides a forwarded phone notification needs no answer and replies `NO_REPLY`, the turn fails with "CLI backend returned an empty response." and OpenClaw retries it on the fallback model. With a subscription CLI backend and an API-billed fallback, every ignored notification becomes a paid request and an "Unable to finish this reply" card in WebChat. ## User Impact User impact: agents can ignore phone notifications again. A `NO_REPLY` answer ends the turn silently, with no error card and no fallback model call. Notifications the agent does answer still get their reply. ## Why This Change Was Made #180106 (e897d98) moved notifications from heartbeat wakes, which allowed silence, onto ordinary host session events, without carrying over that permission. The notification producer now passes `replyExpectation: "optional"`, the same producer-owned waiver cron notifications and session-state notices already pass. Input provenance alone still grants no silence, so other `internal_system` turns keep their result requirement. The branch keeps the contributor's fix commit. The in-process Gateway test and the docs note are folded into one assertion in the existing notification routing case, which fails on `main` and passes here. ## Evidence Isolated source Gateway (`ocx src`), loopback, throwaway state. The agent's primary and fallback models are a scripted local CLI backend that logs every call. A WebChat client sends `chat.send` to `agent:main:main`, then a paired `openclaw-android` node sends `notifications.changed` for a promo (model answers `NO_REPLY`) and for a bank alert (model answers with text, the control). ``` main 93d8403 promo-1: model calls=2 primary -> NO_REPLY, fallback -> "fallback answer for promo-1" cli terminal failure: provider=scripted-cli model=primary ... error=CLI backend returned an empty response. model fallback decision: decision=candidate_failed ... reason=empty_response next=scripted-cli/fallback urgent-1 (control): model calls=1, reply delivered this PR promo-1: model calls=1 primary -> NO_REPLY; no assistant message, 0 empty_response lines, 0 fallback decisions urgent-1 (control): model calls=1, reply delivered ``` Regression test: `src/gateway/server-node-events.test.ts` passes 52/52 here; on `main` the two notification routing cases fail on the missing `replyExpectation: "optional"`. <details> <summary>Contributor live run with the real claude-cli backend (redacted; Gateway lines in IST, client lines in UTC)</summary> ``` ### AFTER (this PR) [2026-11-17T20:59:06.734Z] phone -> node.event notifications.changed {"change":"posted","key":"proof-1794949146731","packageName":"com.example.shop","title":"Weekend sale","text":"20% off everything this weekend"} [2026-11-17T20:59:29.741Z] gateway accepted node.event: {"ok":true} [claude stream] text_delta "text":"NO_REPLY" 2026-11-18T02:29:53.981+05:30 [agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-4-5 durationMs=9600 outBytes=8 outHash=b07800ad4773 [2026-11-17T20:59:05.295Z] webchat watching for 150s [2026-11-17T20:59:33.317Z] webchat sees agent {"sessionKey":"agent:main:main","state":"start","stream":"lifecycle"} [2026-11-17T20:59:45.663Z] webchat sees agent {"sessionKey":"agent:main:main","state":"starting_model","stream":"run_status"} [2026-11-17T20:59:52.985Z] webchat sees agent {"sessionKey":"agent:main:main","stream":"thinking"} [2026-11-17T20:59:55.153Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T20:59:55.162Z] webchat sees agent {"sessionKey":"agent:main:main","state":"end","stream":"lifecycle"} [2026-11-17T20:59:55.165Z] webchat sees chat {"sessionKey":"agent:main:main","state":"final"} ### BEFORE (main) [2026-11-17T21:20:11.996Z] phone -> node.event notifications.changed {"change":"posted","key":"proof-1794950411995","packageName":"com.example.shop","title":"Weekend sale","text":"20% off everything this weekend"} [2026-11-17T21:20:21.484Z] gateway accepted node.event: {"ok":true} 2026-11-18T02:50:33.766+05:30 [agent/cli-backend] cli live session start: provider=claude-cli model=claude-haiku-4-5 activeSessions=1 [claude stream] text_delta "text":"NO_REPLY" 2026-11-18T02:50:42.818+05:30 [agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-4-5 durationMs=9391 outBytes=8 outHash=b07800ad4773 2026-11-18T02:50:42.845+05:30 [agent/cli-backend] cli empty response diagnostics: backend=claude-cli reason=exit exitCode=0 exitSignal=null durationMs=9158 stdoutBytes=19295 stdoutHash=01933c6de95a stderrBytes=0 stderrHash=e3b0c44298fc useResume=false 2026-11-18T02:50:42.854+05:30 [agent/cli-backend] cli terminal failure: provider=claude-cli model=claude-haiku-4-5 durationMs=19303 runId=<id> error=CLI backend returned an empty response. 2026-11-18T02:50:44.443+05:30 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-4-5 candidate=anthropic/claude-haiku-4-5 reason=empty_response next=openai/gpt-5.4 2026-11-18T02:51:02.161+05:30 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-4-5 candidate=openai/gpt-5.4 reason=model_not_found next=none 2026-11-18T02:51:02.198+05:30 Embedded agent failed before reply: All models failed (2): anthropic/claude-haiku-4-5: CLI backend returned an empty response. (empty_response) | openai/gpt-5.4: Unknown model: openai/gpt-5.4. GPT-5.4 has retired from the ChatGPT-account Codex route. Run `openclaw doctor --fix` to replace it with gp 2026-11-18T02:51:03.236+05:30 [gateway] notification event not delivered node=<node-id>: failed [2026-11-17T21:20:06.510Z] webchat watching for 150s [2026-11-17T21:20:23.374Z] webchat sees agent {"sessionKey":"agent:main:main","state":"start","stream":"lifecycle"} [2026-11-17T21:20:33.822Z] webchat sees agent {"sessionKey":"agent:main:main","state":"starting_model","stream":"run_status"} [2026-11-17T21:20:42.640Z] webchat sees agent {"sessionKey":"agent:main:main","stream":"thinking"} [2026-11-17T21:20:44.529Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T21:20:44.533Z] webchat sees agent {"sessionKey":"agent:main:main","state":"fallback_step","stream":"lifecycle"} [2026-11-17T21:21:02.019Z] webchat sees agent {"sessionKey":"agent:main:main","state":"preparing_workspace","stream":"run_status"} [2026-11-17T21:21:02.275Z] webchat sees agent {"sessionKey":"agent:main:main","state":"preparing_context","stream":"run_status"} [2026-11-17T21:21:02.275Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T21:21:02.277Z] webchat sees agent {"sessionKey":"agent:main:main","state":"fallback_step","stream":"lifecycle"} [2026-11-17T21:21:02.295Z] webchat sees agent {"sessionKey":"agent:main:main","state":"error","stream":"lifecycle"} [2026-11-17T21:21:03.162Z] webchat sees chat {"sessionKey":"agent:main:main","state":"error","error":"All models failed (2): anthropic/claude-haiku-4-5: CLI backend returned an empty response. (empty_response) | openai/gpt-5.4: Unknown model: openai/gpt-5.4. GPT-5.4 has retired from the ChatGPT-account Codex route. Run `openclaw doctor --fi..."} ``` Node IDs, run IDs and local paths are redacted. All traffic is on 127.0.0.1. The extra `claude-haiku-5-5` CLI turn after each run is OpenClaw's utility session recap, not a retry. </details> Merge danger: two-way door. One field on one producer, no stored state or contract change; a revert restores the 2026.11.5 behavior. Blast radius: forwarded device notifications only. Co-authored-by: Ayaan Zaidi <[email protected]>
…paid model (openclaw#200741) Root cause: src/gateway/server-node-events-notifications.ts:128 admits phone notifications through `enqueueSessionEventForHost` without the producer's `replyExpectation: "optional"`, so in a WebChat session the `internal_system` turn resolves as result-required (src/agents/reply-completion.ts:116-122) and the CLI runner rejects an authored `NO_REPLY` as `empty_response`, which starts model fallback. Fixes openclaw#200710 Thanks @dawidkulpa for the report with exact before/after counts, and @vaibhav375 for the fix. ## What Problem This Solves Since 2026.11.5, when an agent decides a forwarded phone notification needs no answer and replies `NO_REPLY`, the turn fails with "CLI backend returned an empty response." and OpenClaw retries it on the fallback model. With a subscription CLI backend and an API-billed fallback, every ignored notification becomes a paid request and an "Unable to finish this reply" card in WebChat. ## User Impact User impact: agents can ignore phone notifications again. A `NO_REPLY` answer ends the turn silently, with no error card and no fallback model call. Notifications the agent does answer still get their reply. ## Why This Change Was Made openclaw#180106 (a67f6bd) moved notifications from heartbeat wakes, which allowed silence, onto ordinary host session events, without carrying over that permission. The notification producer now passes `replyExpectation: "optional"`, the same producer-owned waiver cron notifications and session-state notices already pass. Input provenance alone still grants no silence, so other `internal_system` turns keep their result requirement. The branch keeps the contributor's fix commit. The in-process Gateway test and the docs note are folded into one assertion in the existing notification routing case, which fails on `main` and passes here. ## Evidence Isolated source Gateway (`ocx src`), loopback, throwaway state. The agent's primary and fallback models are a scripted local CLI backend that logs every call. A WebChat client sends `chat.send` to `agent:main:main`, then a paired `openclaw-android` node sends `notifications.changed` for a promo (model answers `NO_REPLY`) and for a bank alert (model answers with text, the control). ``` main 7bd8ea3 promo-1: model calls=2 primary -> NO_REPLY, fallback -> "fallback answer for promo-1" cli terminal failure: provider=scripted-cli model=primary ... error=CLI backend returned an empty response. model fallback decision: decision=candidate_failed ... reason=empty_response next=scripted-cli/fallback urgent-1 (control): model calls=1, reply delivered this PR promo-1: model calls=1 primary -> NO_REPLY; no assistant message, 0 empty_response lines, 0 fallback decisions urgent-1 (control): model calls=1, reply delivered ``` Regression test: `src/gateway/server-node-events.test.ts` passes 52/52 here; on `main` the two notification routing cases fail on the missing `replyExpectation: "optional"`. <details> <summary>Contributor live run with the real claude-cli backend (redacted; Gateway lines in IST, client lines in UTC)</summary> ``` ### AFTER (this PR) [2026-11-17T20:59:06.734Z] phone -> node.event notifications.changed {"change":"posted","key":"proof-1794949146731","packageName":"com.example.shop","title":"Weekend sale","text":"20% off everything this weekend"} [2026-11-17T20:59:29.741Z] gateway accepted node.event: {"ok":true} [claude stream] text_delta "text":"NO_REPLY" 2026-11-18T02:29:53.981+05:30 [agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-4-5 durationMs=9600 outBytes=8 outHash=b07800ad4773 [2026-11-17T20:59:05.295Z] webchat watching for 150s [2026-11-17T20:59:33.317Z] webchat sees agent {"sessionKey":"agent:main:main","state":"start","stream":"lifecycle"} [2026-11-17T20:59:45.663Z] webchat sees agent {"sessionKey":"agent:main:main","state":"starting_model","stream":"run_status"} [2026-11-17T20:59:52.985Z] webchat sees agent {"sessionKey":"agent:main:main","stream":"thinking"} [2026-11-17T20:59:55.153Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T20:59:55.162Z] webchat sees agent {"sessionKey":"agent:main:main","state":"end","stream":"lifecycle"} [2026-11-17T20:59:55.165Z] webchat sees chat {"sessionKey":"agent:main:main","state":"final"} ### BEFORE (main) [2026-11-17T21:20:11.996Z] phone -> node.event notifications.changed {"change":"posted","key":"proof-1794950411995","packageName":"com.example.shop","title":"Weekend sale","text":"20% off everything this weekend"} [2026-11-17T21:20:21.484Z] gateway accepted node.event: {"ok":true} 2026-11-18T02:50:33.766+05:30 [agent/cli-backend] cli live session start: provider=claude-cli model=claude-haiku-4-5 activeSessions=1 [claude stream] text_delta "text":"NO_REPLY" 2026-11-18T02:50:42.818+05:30 [agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-4-5 durationMs=9391 outBytes=8 outHash=b07800ad4773 2026-11-18T02:50:42.845+05:30 [agent/cli-backend] cli empty response diagnostics: backend=claude-cli reason=exit exitCode=0 exitSignal=null durationMs=9158 stdoutBytes=19295 stdoutHash=01933c6de95a stderrBytes=0 stderrHash=e3b0c44298fc useResume=false 2026-11-18T02:50:42.854+05:30 [agent/cli-backend] cli terminal failure: provider=claude-cli model=claude-haiku-4-5 durationMs=19303 runId=<id> error=CLI backend returned an empty response. 2026-11-18T02:50:44.443+05:30 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-4-5 candidate=anthropic/claude-haiku-4-5 reason=empty_response next=openai/gpt-5.4 2026-11-18T02:51:02.161+05:30 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-4-5 candidate=openai/gpt-5.4 reason=model_not_found next=none 2026-11-18T02:51:02.198+05:30 Embedded agent failed before reply: All models failed (2): anthropic/claude-haiku-4-5: CLI backend returned an empty response. (empty_response) | openai/gpt-5.4: Unknown model: openai/gpt-5.4. GPT-5.4 has retired from the ChatGPT-account Codex route. Run `openclaw doctor --fix` to replace it with gp 2026-11-18T02:51:03.236+05:30 [gateway] notification event not delivered node=<node-id>: failed [2026-11-17T21:20:06.510Z] webchat watching for 150s [2026-11-17T21:20:23.374Z] webchat sees agent {"sessionKey":"agent:main:main","state":"start","stream":"lifecycle"} [2026-11-17T21:20:33.822Z] webchat sees agent {"sessionKey":"agent:main:main","state":"starting_model","stream":"run_status"} [2026-11-17T21:20:42.640Z] webchat sees agent {"sessionKey":"agent:main:main","stream":"thinking"} [2026-11-17T21:20:44.529Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T21:20:44.533Z] webchat sees agent {"sessionKey":"agent:main:main","state":"fallback_step","stream":"lifecycle"} [2026-11-17T21:21:02.019Z] webchat sees agent {"sessionKey":"agent:main:main","state":"preparing_workspace","stream":"run_status"} [2026-11-17T21:21:02.275Z] webchat sees agent {"sessionKey":"agent:main:main","state":"preparing_context","stream":"run_status"} [2026-11-17T21:21:02.275Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T21:21:02.277Z] webchat sees agent {"sessionKey":"agent:main:main","state":"fallback_step","stream":"lifecycle"} [2026-11-17T21:21:02.295Z] webchat sees agent {"sessionKey":"agent:main:main","state":"error","stream":"lifecycle"} [2026-11-17T21:21:03.162Z] webchat sees chat {"sessionKey":"agent:main:main","state":"error","error":"All models failed (2): anthropic/claude-haiku-4-5: CLI backend returned an empty response. (empty_response) | openai/gpt-5.4: Unknown model: openai/gpt-5.4. GPT-5.4 has retired from the ChatGPT-account Codex route. Run `openclaw doctor --fi..."} ``` Node IDs, run IDs and local paths are redacted. All traffic is on 127.0.0.1. The extra `claude-haiku-5-5` CLI turn after each run is OpenClaw's utility session recap, not a retry. </details> Merge danger: two-way door. One field on one producer, no stored state or contract change; a revert restores the 2026.11.5 behavior. Blast radius: forwarded device notifications only. Co-authored-by: Ayaan Zaidi <[email protected]>
…paid model (#200741) Root cause: src/gateway/server-node-events-notifications.ts:128 admits phone notifications through `enqueueSessionEventForHost` without the producer's `replyExpectation: "optional"`, so in a WebChat session the `internal_system` turn resolves as result-required (src/agents/reply-completion.ts:116-122) and the CLI runner rejects an authored `NO_REPLY` as `empty_response`, which starts model fallback. Fixes #200710 Thanks @dawidkulpa for the report with exact before/after counts, and @vaibhav375 for the fix. ## What Problem This Solves Since 2026.11.5, when an agent decides a forwarded phone notification needs no answer and replies `NO_REPLY`, the turn fails with "CLI backend returned an empty response." and OpenClaw retries it on the fallback model. With a subscription CLI backend and an API-billed fallback, every ignored notification becomes a paid request and an "Unable to finish this reply" card in WebChat. ## User Impact User impact: agents can ignore phone notifications again. A `NO_REPLY` answer ends the turn silently, with no error card and no fallback model call. Notifications the agent does answer still get their reply. ## Why This Change Was Made #180106 (e897d98) moved notifications from heartbeat wakes, which allowed silence, onto ordinary host session events, without carrying over that permission. The notification producer now passes `replyExpectation: "optional"`, the same producer-owned waiver cron notifications and session-state notices already pass. Input provenance alone still grants no silence, so other `internal_system` turns keep their result requirement. The branch keeps the contributor's fix commit. The in-process Gateway test and the docs note are folded into one assertion in the existing notification routing case, which fails on `main` and passes here. ## Evidence Isolated source Gateway (`ocx src`), loopback, throwaway state. The agent's primary and fallback models are a scripted local CLI backend that logs every call. A WebChat client sends `chat.send` to `agent:main:main`, then a paired `openclaw-android` node sends `notifications.changed` for a promo (model answers `NO_REPLY`) and for a bank alert (model answers with text, the control). ``` main 93d8403 promo-1: model calls=2 primary -> NO_REPLY, fallback -> "fallback answer for promo-1" cli terminal failure: provider=scripted-cli model=primary ... error=CLI backend returned an empty response. model fallback decision: decision=candidate_failed ... reason=empty_response next=scripted-cli/fallback urgent-1 (control): model calls=1, reply delivered this PR promo-1: model calls=1 primary -> NO_REPLY; no assistant message, 0 empty_response lines, 0 fallback decisions urgent-1 (control): model calls=1, reply delivered ``` Regression test: `src/gateway/server-node-events.test.ts` passes 52/52 here; on `main` the two notification routing cases fail on the missing `replyExpectation: "optional"`. <details> <summary>Contributor live run with the real claude-cli backend (redacted; Gateway lines in IST, client lines in UTC)</summary> ``` ### AFTER (this PR) [2026-11-17T20:59:06.734Z] phone -> node.event notifications.changed {"change":"posted","key":"proof-1794949146731","packageName":"com.example.shop","title":"Weekend sale","text":"20% off everything this weekend"} [2026-11-17T20:59:29.741Z] gateway accepted node.event: {"ok":true} [claude stream] text_delta "text":"NO_REPLY" 2026-11-18T02:29:53.981+05:30 [agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-4-5 durationMs=9600 outBytes=8 outHash=b07800ad4773 [2026-11-17T20:59:05.295Z] webchat watching for 150s [2026-11-17T20:59:33.317Z] webchat sees agent {"sessionKey":"agent:main:main","state":"start","stream":"lifecycle"} [2026-11-17T20:59:45.663Z] webchat sees agent {"sessionKey":"agent:main:main","state":"starting_model","stream":"run_status"} [2026-11-17T20:59:52.985Z] webchat sees agent {"sessionKey":"agent:main:main","stream":"thinking"} [2026-11-17T20:59:55.153Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T20:59:55.162Z] webchat sees agent {"sessionKey":"agent:main:main","state":"end","stream":"lifecycle"} [2026-11-17T20:59:55.165Z] webchat sees chat {"sessionKey":"agent:main:main","state":"final"} ### BEFORE (main) [2026-11-17T21:20:11.996Z] phone -> node.event notifications.changed {"change":"posted","key":"proof-1794950411995","packageName":"com.example.shop","title":"Weekend sale","text":"20% off everything this weekend"} [2026-11-17T21:20:21.484Z] gateway accepted node.event: {"ok":true} 2026-11-18T02:50:33.766+05:30 [agent/cli-backend] cli live session start: provider=claude-cli model=claude-haiku-4-5 activeSessions=1 [claude stream] text_delta "text":"NO_REPLY" 2026-11-18T02:50:42.818+05:30 [agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-4-5 durationMs=9391 outBytes=8 outHash=b07800ad4773 2026-11-18T02:50:42.845+05:30 [agent/cli-backend] cli empty response diagnostics: backend=claude-cli reason=exit exitCode=0 exitSignal=null durationMs=9158 stdoutBytes=19295 stdoutHash=01933c6de95a stderrBytes=0 stderrHash=e3b0c44298fc useResume=false 2026-11-18T02:50:42.854+05:30 [agent/cli-backend] cli terminal failure: provider=claude-cli model=claude-haiku-4-5 durationMs=19303 runId=<id> error=CLI backend returned an empty response. 2026-11-18T02:50:44.443+05:30 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-4-5 candidate=anthropic/claude-haiku-4-5 reason=empty_response next=openai/gpt-5.4 2026-11-18T02:51:02.161+05:30 [model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-4-5 candidate=openai/gpt-5.4 reason=model_not_found next=none 2026-11-18T02:51:02.198+05:30 Embedded agent failed before reply: All models failed (2): anthropic/claude-haiku-4-5: CLI backend returned an empty response. (empty_response) | openai/gpt-5.4: Unknown model: openai/gpt-5.4. GPT-5.4 has retired from the ChatGPT-account Codex route. Run `openclaw doctor --fix` to replace it with gp 2026-11-18T02:51:03.236+05:30 [gateway] notification event not delivered node=<node-id>: failed [2026-11-17T21:20:06.510Z] webchat watching for 150s [2026-11-17T21:20:23.374Z] webchat sees agent {"sessionKey":"agent:main:main","state":"start","stream":"lifecycle"} [2026-11-17T21:20:33.822Z] webchat sees agent {"sessionKey":"agent:main:main","state":"starting_model","stream":"run_status"} [2026-11-17T21:20:42.640Z] webchat sees agent {"sessionKey":"agent:main:main","stream":"thinking"} [2026-11-17T21:20:44.529Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T21:20:44.533Z] webchat sees agent {"sessionKey":"agent:main:main","state":"fallback_step","stream":"lifecycle"} [2026-11-17T21:21:02.019Z] webchat sees agent {"sessionKey":"agent:main:main","state":"preparing_workspace","stream":"run_status"} [2026-11-17T21:21:02.275Z] webchat sees agent {"sessionKey":"agent:main:main","state":"preparing_context","stream":"run_status"} [2026-11-17T21:21:02.275Z] webchat sees agent {"sessionKey":"agent:main:main","state":"model","stream":"lifecycle"} [2026-11-17T21:21:02.277Z] webchat sees agent {"sessionKey":"agent:main:main","state":"fallback_step","stream":"lifecycle"} [2026-11-17T21:21:02.295Z] webchat sees agent {"sessionKey":"agent:main:main","state":"error","stream":"lifecycle"} [2026-11-17T21:21:03.162Z] webchat sees chat {"sessionKey":"agent:main:main","state":"error","error":"All models failed (2): anthropic/claude-haiku-4-5: CLI backend returned an empty response. (empty_response) | openai/gpt-5.4: Unknown model: openai/gpt-5.4. GPT-5.4 has retired from the ChatGPT-account Codex route. Run `openclaw doctor --fi..."} ``` Node IDs, run IDs and local paths are redacted. All traffic is on 127.0.0.1. The extra `claude-haiku-5-5` CLI turn after each run is OpenClaw's utility session recap, not a retry. </details> Merge danger: two-way door. One field on one producer, no stored state or contract change; a revert restores the 2026.11.5 behavior. Blast radius: forwarded device notifications only. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit c97a173) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 063675762f70a26ae5f39b5bbcd093e7431a66e9)
What Problem This Solves
Removes the legacy heartbeat SDK and scheduling entry points now that periodic jobs and plugin producers use ordinary Automations and session events.
User Impact
Plugin authors must replace the removed heartbeat exports and runtime methods using the migration guide. This is the breaking SDK removal Peter approved for #167796 on October 3/12. Existing configurations retain the Doctor migration and once-only notice landed in #179387. Migrated jobs and node notices use the session controller's admission and settlement boundaries.
Why This Change Was Made
S4b follows #180079 in the replacement stack for #179526 and #167796. S1 #178650, S2 #178764, and S3 #179387 (replacing #178990) are already merged. S4c next removes the unreachable executor/outcome store and directly coupled tool implementation; S4d removes the remaining internal turn flags and wake helpers.
This slice removes Gateway heartbeat startup/reload wiring and the private Cron heartbeat payload, with their directly coupled fixtures. Gateway shutdown still joins delivery recovery and upstream monitoring. Node notices retain captured destinations and current-owner checks. Doctor alone owns the legacy schedule/identity decoding. Public wake-policy vocabulary remains supported through ordinary session events.
The removed one-shot retry branch only handled the retired runner's
disabledresult. Its replacement regression proves that an explicitly empty scratch is skipped once and stays consumed across restart, while migrated-task proof verifiesokis recorded only after ordinary execution settles.The typed consumer closure requires 228 paths, mostly one-line removals; executable source is net −479 lines, tests/support net −932, and docs/metadata net +10. No new configuration or lifecycle owner is introduced.
Evidence
The prepared slice passed focused SDK/runtime, node-event, Cron, Gateway, Doctor, and adapter tests, including 378 Gateway cases and 57 Doctor cases. Fresh-main integration preserves the new Cron stream sandbox target and regenerates SDK exports, the database-worker inventory, and shrink-only test baselines through their owners.
Fresh final proof:
pnpm buildpassed; 130 focused tests plus 63 node-event cases after the mechanical extraction passed; core, Gateway, Cron, and SDK type graphs, typed lint, formatting, line-cap ratchet, and owner generators passed.pnpm plugin-sdk:api:diffpassed against the frozen candidate (digest5f4a4578): 9 named heartbeat exports removed, 36 reachable declaration changes, 215 affected exports. The later notification-handler extraction changes no SDK shape. Full-slice and extraction-delta Codex reviews are scoped-clean through P2. Exact-head CI will be recorded before landing. Live external-provider campaigns are not repeated for this removal slice; ordinary admission/settlement and restart behavior are covered at their owning boundaries.The first CI run exposed eight stale Cron fixture fields and tests that still invoked the retired heartbeat executor. Those fixtures now use the current contract; the obsolete runner tests are replaced by 13 ordinary background-exec custody cases. The formatter now admits ordinary exec completion notices while leaving controller-owned events with their owner.
A review also caught an inline-result race in node exec completion: target capture could yield before the registry installed its notice hold. Authorization now installs that hold before capture; target/currentness checks and deduplication still precede enqueue. The owning-boundary regression failed before the repair and passes afterward. Repair proof: 94 fixture tests, 33 exec/restart/formatter cases, 64 node-event cases, and 4 restart/migrated-task cases passed, along with the five failing type graphs, both Gateway graphs, scoped lint/format, and changed-file line-cap checks.
The Feishu response-size cancellation assertions from the first CI attempt passed once on both its clean main revision and candidate with matching Node/Bun pins. This is local nonreproduction of a timing-sensitive fixture assertion, not an inherited-failure or fix claim; exact-head CI determines whether further investigation is needed.
A second CI repair preserves occurrence custody: the default formatter reads only deliverable system events, so it cannot consume an occurrence held by a different delivery owner. Explicit owner selections still work. The unchanged held-occurrence regression failed before this repair; 65 system-event/ordinary-exec cases plus 5 admission/restart cases now pass. Core/infra type graphs, scoped lint/format, and line-cap checks pass; the repair review is scoped-clean through P2.
The later Feishu card-create cancellation and Anthropic diagnostic-drainage assertions also passed once on their exact clean-main and candidate revisions with matching Node/Bun pins. They remain timing-sensitive CI failures not reproduced locally, not proven inherited or fixed. Final-head CI is authoritative.
The exact Feishu job was also replayed on secretless Linux against the actual CI main revision and this candidate, with the same Node/Bun/pnpm pins and worker settings. Both passed all 67 files / 838 cases, including all 625 Feishu cases and the two failed cancellation assertions. The lease had more CPU/RAM than CI, so this is nonreproduction on Linux, not an inherited-failure or fix claim. The single targeted retry passed. Exact-head CI run 39707406420 attempt 2 completed successfully (162 successful, 20 skipped, no failing or non-terminal jobs); native landing merged this slice as e897d98.