Repository navigation
refactor(automations): retire heartbeat executor and response tool - #180192
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 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: bff983a0de
ℹ️ 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".
| @@ -1,417 +0,0 @@ | |||
| import { appendCronStyleCurrentTimeLine } from "../agents/current-time.js"; | |||
There was a problem hiding this comment.
Remove the surviving heartbeat executor test
Deleting this executor leaves src/infra/heartbeat-exec-session-event.test.ts:47-50 importing this module plus three other deleted heartbeat modules. The tracked test still matches the broad src/**/*.test.ts unit-fast discovery pattern, so collecting that suite fails with unresolved-module errors before any tests run; delete or migrate this test as part of the retirement.
AGENTS.md reference: AGENTS.md:L49-L52
Useful? React with 👍 / 👎.
| @@ -1,152 +0,0 @@ | |||
| /** | |||
There was a problem hiding this comment.
Remove the retired tool from the core catalog
After removing the heartbeat_respond factory, src/agents/tool-catalog.ts:228 still declares it as a configurable OpenClaw tool. Consequently tools.catalog, the Control UI, group:automation/group:openclaw expansion, and tool-access diagnostics continue to advertise or accept a capability that can never be constructed; configurations selecting it yield an empty or misleading surface. Retire the catalog entry and its remaining catalog expectations with the factory.
AGENTS.md reference: src/agents/AGENTS.md:L5-L10
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR removes the retired heartbeat executor, response tool, outcome store, and their plumbing after Automations took over execution. Example: An ordinary automation runs every 30 minutes.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Needs changes before merge - 4 items remain Keep open: this maintainer-directed retirement is useful, but the cutover leaves broken test consumers, a stale tool catalog entry, and duplicate test routing. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherCron and producer-owned session events enter ordinary session admission, execute agent work, and leave through existing reply delivery and settlement owners. flowchart LR
Cron[Automation schedules] --> Admission[Session admission]
Events[Producer session events] --> Admission
Admission --> Agent[Agent execution]
Agent --> Delivery[Reply delivery]
Delivery --> Settlement[Session settlement]
Technical reviewBest possible solution: Complete the retirement through the existing owners by migrating retained tests, removing stale catalog metadata, and assigning the restart test to one suite. Do we have a high-confidence way to reproduce the issue? The missing imports and catalog mismatch are directly visible in pinned source, and exact-head CI annotations independently establish obsolete assertions and duplicate suite discovery; no target code was executed. Is this the best way to solve the issue? Removing the unreachable execution model follows the approved ownership design, but the smallest complete cutover must also retire its remaining discovery metadata and test consumers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 461123273058. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
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:
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, 11:25 PM ET / October 22, 2026, 03:25 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2801bc4fb6
ℹ️ 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".
| @@ -1,417 +0,0 @@ | |||
| import { appendCronStyleCurrentTimeLine } from "../agents/current-time.js"; | |||
There was a problem hiding this comment.
Migrate live QA flows off the retired heartbeat tool
When the scheduling QA scenarios are selected, they still require the implementation deleted here: qa/scenarios/scheduling/heartbeat-shared-runtime-live-contract.yaml:119-146 instructs the model to call heartbeat_respond and then asserts that its response updates scratch, while heartbeat-isolated-group-mcp-policy-note.yaml:129 explicitly waits for that tool in the provider request. Because neither the tool nor the outcome/scratch handler now exists, these flows cannot satisfy their assertions; migrate or retire all five scenario references found by the repo-wide search as part of this cutover.
AGENTS.md reference: AGENTS.md:L49-L52
Useful? React with 👍 / 👎.
| @@ -1,152 +0,0 @@ | |||
| /** | |||
There was a problem hiding this comment.
Remove the retired tool from published documentation
After this deletion, several current docs still promise that users and Codex receive heartbeat_respond, including docs/plugins/codex-harness-runtime/replies.md:30-34, docs/plugins/codex-harness/runtime-behavior.md:98-99, and the tool inventory at docs/tools/index.md:96. Users following those pages will configure or prompt for a tool that can no longer be constructed, so the operational and tool-policy docs need to describe the ordinary automation completion path instead.
AGENTS.md reference: AGENTS.md:L49-L52
Useful? React with 👍 / 👎.
…heartbeat modules Main retired the heartbeat executor (openclaw#180192) and reshaped two helpers this branch imported, so the merge left it unable to compile or bundle: - `./heartbeat-typing.js` is gone. The indicator now builds its typing callbacks itself from `createTypingCallbacks` over the channel's `heartbeat.sendTyping`/`clearTyping` adapter, which every channel still provides. - `./heartbeat-runner-config.js` is gone. The `typingMode: "never"` opt-out and the configured keepalive cadence are read directly from the agent config; the cadence helper is exported as `resolveBackgroundActivityTypingIntervalSeconds`. - `resolveCronJobBoundSessionKeys` became `resolveCronJobSessionBindings`, whose map keys are the same canonical session keys. - `extractDeliveryInfo` is now async, so the delivery resolver is awaited. Also adds the test-lines allocation for the branch's two suites. Co-Authored-By: Claude <[email protected]>
Related: #167796, #179526
What Problem This Solves
Removes the unreachable heartbeat executor, scheduler, response tool, and outcome store after Automations and ordinary session events took over their runtime entry points. Keeping these definitions leaves a second execution model in the codebase even though Gateway and plugin producers no longer use it.
User Impact
Periodic jobs continue through the session controller's admission and settlement path. Doctor's heartbeat migration and once-only notice remain intact. This completes the executor portion of Peter's October 3/12 design; the breaking SDK retirement is documented in the migration guide and handled by #180106.
Why This Change Was Made
This is S4c, following S4a #180079 and S4b #180106, in the replacement stack for #179526 and #167796. The earlier slices are S1 #178650, S2 #178764, and S3 #179387 (replacing #178990). S4d follows with the remaining internal turn flags, bootstrap branches, and wake helpers.
Delete the retired runner/scheduler, response-tool plumbing, outcome publication, and their direct tests together. Preserve active coverage at ordinary owners: background exec custody, Cron restart and execution budgets, session-event delivery, and Gateway publication. The shared response/metadata types require a wider mechanical caller update; no compatibility shim or second lifecycle owner is introduced.
Evidence
The prepared source passed its build, 313 focused cases, scoped production/test type graphs, typed lint/format, prompt snapshots and owner-generated inventories. Subsequent repairs passed 89 payload/CLI cases, 76 stream/tool cases and the retained manual-wake test. Reuse is limited to unchanged inputs. Independent full-source and correction reviews are scoped-clean through P2.
Current integration preserves main's source-turn authority, execution selections, queue-input adapter and shared Doctor session-target helper. The merge delta passed 50 tool-search cases, 12 routing cases, 7 Doctor cases, the recovered-event execution-budget case and both unadopted restart cases. Infra, Cron and tooling type graphs plus scoped lint/format pass. The merge-only Codex review is scoped-clean through P2.
CI run
39725029055completed with 118 unique terminal jobs: 93 successful, 23 skipped, one failed planner job and its aggregate gate. All nine UI E2E shards and security-fast passed. The planner expected-owner assertion failed identically on clean mainff72a99a13bfand the candidate: main #180173 added a native-subagent test importing the authority helper but omitted that consumer from the expected-owner list. This PR adds the missing required owner without widening allowed areas or weakening the assertion. The exact row now passes (1 selected, 40 skipped; wrapper 57.42 seconds), the tooling type graph and scoped lint/format pass, and the one-line correction has a scoped-clean P2 Codex review. Final exact-head CI run39732714192ondabb48155c13completed successfully. The separate OpenGrep job blocked native landing on two inherited read-only environment lookups; no merge was dispatched.One local limitation remains: the adopted-turn/transport settlement test timed out, and its isolated candidate replay lost its worker at the existing no-output watchdog. Clean main passed the exact case in 11.06 seconds. This is not classified as inherited or claimed fixed; candidate CI runtime jobs passed. The broader worker-inventory refresh also stalled locally and supplies no fresh proof; its existing generated artifact is unchanged. No timeout, assertion, skip or budget was weakened.
The earlier UI color assertion passed on Linux for both main and candidate, with all 15 audited UI inputs unchanged on the integrated head. No external-provider live campaign was repeated. The live session-event probe now uses ordinary Cron jobs; boundary tests exercise production admission/settlement with synthetic I/O.
Current slice against integrated main: 175 files, +631/−17,470 (net -16,839). The shared typed closure explains the file count; no compatibility shim or new owner was added. Original design and implementation: Peter Steinberger (#167796).
The OpenGrep correction keeps dangerous override keys and sanitizer calls detectable while excluding read-only
resolveEnvironmentValuearguments. Static fixtures cover both safe reads and six forbidden overrides, including helper-valued overrides. The compiled rulepack was regenerated by its owner, validated, and checked with OpenGrep 1.30.2. TypeScript is listed first because the scanner test runner uses the first language to parse its fixtures; all three supported languages are retained. The affected production file scans cleanly, and the correction has a scoped-clean P2 Codex review. Application behavior and the security workflow are unchanged. Final exact-head CI follows this correction.Latest integration (
c7490d9fb7c7) brings main8c5918e8f83bwithout conflicts and retains the new scheduled-command authority test in the planner’s required-owner list. The prior run exposed that missing expectation after main #180282. Targeted tooling types, typed lint, format and direct planner owner selection pass; the selected Vitest process stalled at the unchanged no-output watchdog. The merge-overlap delta has a scoped-clean P2 review. Separate OpenGrep run39741604222passed the detector correction. Exact-head CI follows this merge.The follow-up merge (
691d782b0ca8) preserves both active Cron proof and main’s new session-initialization worker registration. The registry entry is grouped with its event-owner siblings; no test was dropped. Registry validation, lint/format and the exact two-file integration review passed. Original Doctor CI missing-detail failure remains unclassified: clean-main replay fails at a later reason assertion, while the local candidate worker aborted without a product verdict. The immediate Linux allocation was unavailable and cancelled; current-head CI determines the next action.Final exact-head CI
39748990771on691d782b0ca8completed: 95 successful, 23 skipped, onlycheck-test-types-core-5(job119725835117) and its aggregate gate failed. Clean main baseline3b766f691d46reproduces the identicalTS2353atui/src/pages/plugins/plugins-page.credentials.test.ts:42incore-test-ui-pages(compiler exit 2, 5.6 seconds). All 18 audited test/type/config/dependency inputs are byte-identical in the tested merge. This unrelated inherited UI failure uses the maintainer-authorized native exception. OpenGrep39748990870passed, and all runtime test jobs passed; no phantom jobs or reruns were needed.Latest integration: merged main
ad3101dfff69and regenerated the database-worker inventory through its owner. The scoped tooling typecheck, typed lint, format, and two inventory tests passed. The merge-overlap review is scoped-clean through P2. The inventory refresh now completes successfully. Prior-head CI and failure attribution remain historical evidence; the new head receives its own CI.The latest local unadopted-event restart replay ended at the unchanged no-output watchdog before any assertion verdict. The prior boundary proof is retained; current-head CI supplies the broad runtime result.