Repository navigation
Conversation
Convert monitoring into editable agentTurn automations and route immediate completion events through normal session admission and delivery ownership. Remove the heartbeat executor, coordinator, response tool, and steady-state outcome machinery rather than renaming them. Migrate existing cadence, policies, scratch, history, and pending context with Doctor. Preserve edits and deletion through durable provisioning receipts. Advance the approved shared schema to 16; keep agent schema 19, the inert heartbeat_outcomes table, and Gateway protocol 4 adapters. Track deferred database and protocol-v5 removals at their existing owners. Repair delayed-completion root/transcript ownership, migration and portable artifact boundary defects, and clipped System busyness outcomes. Update CLI, SDK, native and Control UI consumers, documentation, and regressions. Adopt the retained-API portion of #135322 without its release changes. Verified focused owner/sibling tests, real OpenClaw/Codex completion and scheduling flows, stable-source copied-state migration, real UI editing, and independent final blocking-issue review. Production net -620 lines. Draft review gates remain explicit: three legitimate SDK deprecations exceed unchanged budgets; the former 24-hour cross-occurrence alert suppression needs a compatibility decision. Native runtime proof remains incomplete. No merge, release, or operator deployment is part of this change. Related: #134994
|
🦞👀 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. |
Share one closed execution-status projection across terminal callbacks, invocation-owned reply receipts and message-tool reporting. Preserve independent delivery evidence, callback ordering, abort handling and persisted status values. Production LOC: -4. No database, config, protocol or scheduler changes. Validation: 283 focused candidate tests; 40 tests after the unchanged case move; production/core-test types, lint and repository guards. Independent Codex reviews found no actionable findings. Exact-source isolated real-provider Gateway parity passed on OpenClaw and Codex: https://github.com/openclaw/openclaw/actions/runs/33858740814. The pre-existing NO_REPLY fallback diagnostic remains a named follow-up. Exact-head CI: 129 checks passed and 43 skipped. Two production audit attempts exhausted npm advisory-service request timeouts; security-fast and its aggregate are the only failures. The maintainer explicitly waived this availability failure and dependent gate. Native prepare validated review artifacts, then rejected the failed aggregate; no green gate stamp or audit clearance is claimed. Landing uses that narrow maintainer-authorized exception. Related: #135933
Terminal !poll now consumes the exact process-owned completion receipt, matching process.poll while preserving other pending occurrences. Consolidate captured event routing and heartbeat settlement without changing cadence, readiness retries, suppressed-send retention, or persisted state. Keep the shipped coding-tool SDK declarations accepted and document the acknowledgment behavior. Production code shrinks by 49 lines. Related: #135933
* fix(exec): acknowledge polled completions Terminal !poll now consumes the exact process-owned completion receipt, matching process.poll while preserving other pending occurrences. Consolidate captured event routing and heartbeat settlement without changing cadence, readiness retries, suppressed-send retention, or persisted state. Keep the shipped coding-tool SDK declarations accepted and document the acknowledgment behavior. Production code shrinks by 49 lines. Related: #135933 * fix(exec): settle poll acknowledgements after delivery * test(exec): acknowledge persisted poll results in fixtures
…137875) Make heartbeat and Skill Workshop reconciliation an explicit shared owner in Gateway startup, lazy loading, and configuration reload. Preserve ordered convergence, supersession fencing, retries, shutdown, and publication while deleting duplicated control flow. Also synchronize the existing terminal-recovery test with its fake-clock restart poll. No database schema, persisted format, configuration, or Gateway protocol change. Related to openclaw#135933. Production LOC: +66/-94 (net -28). Validation: 756 focused tests, changed-code checks, independent review, and all exact-head code CI passed. The maintainer explicitly waived only npm advisory-service availability failures (timeouts and HTTP 503) and their dependent aggregate gate for this landing. No audit clearance is claimed; dependencies and audit policy are unchanged.
…law#138127) Share one closed execution-status projection across terminal callbacks, invocation-owned reply receipts and message-tool reporting. Preserve independent delivery evidence, callback ordering, abort handling and persisted status values. Production LOC: -4. No database, config, protocol or scheduler changes. Validation: 283 focused candidate tests; 40 tests after the unchanged case move; production/core-test types, lint and repository guards. Independent Codex reviews found no actionable findings. Exact-source isolated real-provider Gateway parity passed on OpenClaw and Codex: https://github.com/openclaw/openclaw/actions/runs/33858740814. The pre-existing NO_REPLY fallback diagnostic remains a named follow-up. Exact-head CI: 129 checks passed and 43 skipped. Two production audit attempts exhausted npm advisory-service request timeouts; security-fast and its aggregate are the only failures. The maintainer explicitly waived this availability failure and dependent gate. Native prepare validated review artifacts, then rejected the failed aggregate; no green gate stamp or audit clearance is claimed. Landing uses that narrow maintainer-authorized exception. Related: openclaw#135933
* fix(exec): acknowledge polled completions Terminal !poll now consumes the exact process-owned completion receipt, matching process.poll while preserving other pending occurrences. Consolidate captured event routing and heartbeat settlement without changing cadence, readiness retries, suppressed-send retention, or persisted state. Keep the shipped coding-tool SDK declarations accepted and document the acknowledgment behavior. Production code shrinks by 49 lines. Related: openclaw#135933 * fix(exec): settle poll acknowledgements after delivery * test(exec): acknowledge persisted poll results in fixtures
Carry physical session-store claims through admission and reclamation, and claim silent heartbeat context at the shared runtime boundary. Preserve current foreground maintenance, context fragments, and archive ownership. Related: #135933.
Consolidate monitoring execution and delivery with ordinary replies, route isolated cron through the shared agent entry, and keep immediate cron retries in the canonical wake queue. Preserve quiet/alert policy, scratch ownership, cancellation, and durable delivery custody while removing duplicate runtime paths. Carry actual admission outcomes through monitoring so foreground work winning late leaves cron and exec events pending for retry. Preserve CLI/native auth and lifecycle fences for saved context and route recovery through the canonical agent/store owner. Preserve separate physical stores when reconciling exhausted recovery attempts. No new database schema, configuration, protocol, or migration requirement. Existing heartbeat public contracts remain supported. Production decreases by 56 lines in this slice and 68 across the two slices. Related: #135933, #138451.
Consolidate monitoring execution and delivery with ordinary replies, route isolated cron through the shared agent entry, and keep immediate cron retries in the canonical wake queue. Preserve quiet/alert policy, scratch ownership, cancellation, and durable delivery custody while removing duplicate runtime paths. Carry actual admission outcomes through monitoring so foreground work winning late leaves cron and exec events pending for retry. Preserve CLI/native auth and lifecycle fences for saved context and route recovery through the canonical agent/store owner. Preserve separate physical stores when reconciling exhausted recovery attempts. No new database schema, configuration, protocol, or migration requirement. Existing heartbeat public contracts remain supported. Production decreases by 56 lines in this slice and 68 across the two slices. Related: #135933, #138451.
) * refactor: share heartbeat and cron execution with reply runtime Consolidate monitoring execution and delivery with ordinary replies, route isolated cron through the shared agent entry, and keep immediate cron retries in the canonical wake queue. Preserve quiet/alert policy, scratch ownership, cancellation, and durable delivery custody while removing duplicate runtime paths. Carry actual admission outcomes through monitoring so foreground work winning late leaves cron and exec events pending for retry. Preserve CLI/native auth and lifecycle fences for saved context and route recovery through the canonical agent/store owner. Preserve separate physical stores when reconciling exhausted recovery attempts. No new database schema, configuration, protocol, or migration requirement. Existing heartbeat public contracts remain supported. Production decreases by 56 lines in this slice and 68 across the two slices. Related: #135933, #138451. * refactor: decouple heartbeat policy from reply run state * fix: retain source session ownership for bound ACP admission Keep lifecycle reset and admission in the source agent store while bound ACP execution retains its target. Update fixtures to canonical queue, store-owner, and no-send proof contracts, and register the added QA and regression coverage.
…nclaw#138451) Carry physical session-store claims through admission and reclamation, and claim silent heartbeat context at the shared runtime boundary. Preserve current foreground maintenance, context fragments, and archive ownership. Related: openclaw#135933.
…claw#139624) * refactor: share heartbeat and cron execution with reply runtime Consolidate monitoring execution and delivery with ordinary replies, route isolated cron through the shared agent entry, and keep immediate cron retries in the canonical wake queue. Preserve quiet/alert policy, scratch ownership, cancellation, and durable delivery custody while removing duplicate runtime paths. Carry actual admission outcomes through monitoring so foreground work winning late leaves cron and exec events pending for retry. Preserve CLI/native auth and lifecycle fences for saved context and route recovery through the canonical agent/store owner. Preserve separate physical stores when reconciling exhausted recovery attempts. No new database schema, configuration, protocol, or migration requirement. Existing heartbeat public contracts remain supported. Production decreases by 56 lines in this slice and 68 across the two slices. Related: openclaw#135933, openclaw#138451. * refactor: decouple heartbeat policy from reply run state * fix: retain source session ownership for bound ACP admission Keep lifecycle reset and admission in the source agent store while bound ACP execution retains its target. Update fixtures to canonical queue, store-owner, and no-send proof contracts, and register the added QA and regression coverage.
|
#164265 supersedes this draft as the active implementation of the approved #134994 design. Its reviewed candidate has been rebased onto newer main and is published on The October 3 maintainer decisions are implemented there: migrated heartbeats use ordinary Automations delivery with a one-time Doctor notice, and deprecated heartbeat SDK exports are removed as an approved breaking change while the deprecated-export budget stays at 1. Fresh validation and exact-head landing are in progress; the replacement PR records current proof and gaps. This original draft remains open for maintainer disposition. |
Related: #134994 — retire heartbeat into ordinary automations and session execution.
Additional instructions
This branch is in the main repository and remains editable by maintainers. This is a draft: the explicit remaining decisions and proof gaps below are not waived by publication. No merge or release is requested.
What Problem This Solves
Resolves a problem where operators managing monitoring through Automations still encounter a separate heartbeat executor, configuration and reconciliation path, while System busyness shows bare heartbeat events rather than identifiable work and outcomes. Background process, task, hook and restart notices also depend on that special path, even when periodic monitoring is disabled.
The split ownership makes automation edits/deletion unreliable and couples immediate session work to a scheduler that should not own it. This change retires the execution subsystem rather than renaming or hiding its events.
Why This Change Was Made
Scheduled monitoring becomes ordinary editable
agentTurnjobs. Immediate completions and notices use normal session admission, follow-up queues and delivery, with exact lifecycle, cancellation, authority and original-route ownership. There is no replacement heartbeat scheduler, special response tool or outcome store.Doctor converts existing jobs in place, preserving IDs, disabled state, anchors, pending scheduling slots, history and scratch revisions. A provisioning/cutover receipt in existing configuration state prevents restart or repeated Doctor from recreating a deleted job. Migration plans asynchronous work before synchronous SQLite commits, verifies canonical data before removing legacy inputs, and fails visibly on ambiguous/corrupt receipts.
The approved shared-state 15 → 16 fence prevents older gateways from silently ignoring migrated execution/delivery policies. Agent schema stays 19;
heartbeat_outcomesremains structurally present but inert after meaningful pending context is migrated once. Deferred physical deletion is tracked insrc/state/README.md. Gateway protocol stays 4, with narrow deprecated external adapters backed by canonical cron/session machinery; eventual wire removals are tracked as protocol-v5 TODOs.Investigation also reproduced and fixed two host-lifecycle leaks: delayed completion inherited a disposed transcript writer, and real predispatch admission inherited an already-released Gateway root. The completion handoff now uses existing independent-root and transcript-detachment owners through actual settlement, including queued execution, with cancellation removing the exact suspended admission waiter. Existing shutdown and target-generation fences remain intact.
User Impact
Operators can edit monitoring like any other automation. Optional per-job active hours, idle-only execution, owner delivery, direct-message policy and explicit-empty-scratch behavior are available through ordinary authoring surfaces. Scratch CAS and self-scoped result recording belong to the existing
automationstool; ordinaryNO_REPLYprovides silence. Missing scratch remains distinct from explicitly empty scratch.Immediate results no longer require periodic monitoring. Busy foreground turns are not interrupted, original delivery routes are retained, and reset/replaced sessions reject stale work. Ordinary run history and System busyness expose job/run identity and actual outcomes. An explicit-empty skip remains
skippedwith failed completion/CLI exit 1, while known non-delivery is recorded asnot-deliveredrather than unknown. Raw protocol-v4 compatibility diagnostics remain available in a separately labeled legacy-inspection section.Draft decisions / remaining merge gates:
reply-runtime4 / 1. Public entrypoint/export/callable counts are unchanged at 147 / 4355 / 2593. No tags were hidden, APIs deleted, counters raised or environment overrides used. Accepting those exact deprecation-budget changes still needs an explicit maintainer decision.Evidence
Owner and integration checks. Final combined execution/lifecycle/Doctor/SDK/status selection passed 612 tests in 31 files. The preceding coherent cleanup selection passed 4,226 tests in 135 files, plus 168 E2E tests; these selections overlap and are not summed. Full type programs, lint, static/runtime import-cycle checks, protocol/Swift-generation/native-schema guards, SDK public-name parity and the private-QA build passed. Final retention tests, docs MDX/links/glossary checks and build passed after adopting the retained-API portion of #135322 — retain shipped plugin contracts. That resolved the five dated SDK expiry failures without deleting APIs or moving dates. The overall changed check is still red on the two deprecation-count overages above.
Representative commands actually executed:
Real execution. Live proof run passed both OpenClaw and Codex runtime cells: exec completion with cron disabled, asserted busy overlap without interruption, real child spawn/read/result after the foreground turn ended, exactly one child delivery to the original direct conversation, natural main-session cron delegation and reset fencing. Natural cron deduplication and model-created one-shot/recurring/restart scenarios also passed, with no skipped cells or retried model actions. A separate metadata lane used a mock provider and is labeled as such. One earlier setup-only attempt failed on a stale prepared dependency; a fresh normal frozen-lockfile install repaired preparation before any model action ran.
This live run used the fixed pre-cleanup candidate. Every later live-to-final change was classified during integration; the handoff execution/settlement body retained parity apart from private naming, type-only ownership and formatting, and the root helper differed only in its ownership comment. It is not claimed that the final source fingerprint itself ran the earlier model suite. The observed Codex executable was version 0.151.0; upstream response-model identity was not available. Upstream dynamic-tool and turn-lifecycle contracts were inspected directly, independently of the installed binary identity.
Actual stable-source migration. Synthetic data was produced through the actual
v2026.8.1production owners at shared schema 15 / agent 19, not inserted using current-schema fixture SQL. Built Doctor migrated a writable copy to 16/19, preserving job identity, disabled cadence/anchor, history, sessions and exact scratch bytes/revision. Meaningful pending context migrated once; the inert table remained. Repeated Doctor preserved domain state. Ordinary cadence/scratch edits, stale-CAS rejection and permanent deletion survived further Doctor runs. The actual old reader refused schema 16 without changing either database; the candidate reopened, and a separate restored backup opened through stable owners. All original protected paths retained their hashes, modes, flags and inodes. This is stable-source synthetic-data proof, not an installed-npm or real-user-history claim.Independent review. Fresh complete-target Codex autoreview completed with exit 0,
scoped-cleanat P0, across 36 complete bounded passes with zero findings; 27 complete owner modules were supplied as additional context. The reviewed final source is byte-identical to the final UI/proof snapshot. This is scoped blocking-issue review, not a claim of a separate P1/P2 pass.Visual proof. The final real-Gateway flow passed: actual canonical diagnostics and job/run/skipped event, UI name/window edits with strict effective-policy readback, exact scratch content at revision 2, and retained Skipped/Not delivered history. Recording caught a real layout bug: inherited
nowrapclipped the run ID and hid the outcome despite correct DOM text. One event-scoped CSS declaration fixes it; the existing browser test failed on real line geometry at desktop/mobile widths before the change and passed afterward. Nineteen debug-owner tests, scoped checks/types/styles and canonicalpnpm ui:buildalso passed. All 10,951 non-UI build entries remained byte-identical to the earlier full build.The final layout regression and UI build commands were:
Before/after fixture-only images and a cropped editor/scratch/history recording excerpt have been independently inspected for publication. The excerpt omits opening machine diagnostics and a capture-only gray transition; it is not presented as the full continuous recording. Original captures are retained locally. Earlier recorder assumptions about unexported execution fields, explicit
bestEffort:falsedefault materialization, and a hidden history-filter match were corrected at the observed public/UI contracts, without changing runtime behavior to satisfy the recorder.Size. The 973-path patch is production +10,854 / −11,474 (net −620); tests/support +12,658 / −24,835 (net −12,177). Generated/snapshots net −7, tooling/configuration net −6, docs net +345 and QA scenarios/support net +337 are separate. Same-category moves cancel in net totals. No root changelog, dependency, budget or protocol-version changes are included.
Current GitHub state. Head
c0cb2d87eb15cff3325137e319cf5c283cc755b0is draft and GitHub reportsCONFLICTINGwith currentmain. Normal pull-request CI has not attached; successful metadata/triage checks are not runtime CI. A main rebase and exact-head CI are still required before readiness, alongside the explicit decisions and native proof gaps above.No operator Gateway, live state, credentials or native app Keychain was used for proof. Owned proof Gateways, browsers and Testbox leases are cleaned up; no agent transcripts are attached. The PR remains draft pending the named compatibility decisions, native proof gaps and exact-head CI evidence.
attachment-1942024357.webm