Skip to content

refactor: remove retired heartbeat and queue helpers - #180915

Merged
steipete merged 2 commits into
mainfrom
dbasync/knipclean
Oct 22, 2026
Merged

steipete merged 2 commits into
mainfrom
dbasync/knipclean

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The retired heartbeat executor and queue activation path left unused helpers, obsolete unit cases, and stale mock exports in the auto-reply code.

User Impact

No user-visible behavior change. Current heartbeat response handling, queue recovery, system-event ownership, and the public system-event payload remain intact.

Why This Change Was Made

The last runtime callers disappeared in #180192 and #180563. Delete the superseded helpers and their obsolete tests. The queue recovery tests now enter through the existing scheduleFollowupDrain owner. Keep SystemEvent.deliveryHeld and its delivery filter because that shape remains public.

The change removes 183 net lines: production +2/-119, tests +6/-70, and two obsolete mock-baseline rows. It adds no state, cache, requests, SQL, schema changes, or dependencies.

Evidence

Acceptance rule: on the same source baseline, the canonical production and full-tree Knip export counts must fall, the scripts count must not increase, and the affected recovery/ownership tests and static checks must retain their contracts. This cleanup makes no wall-clock, CPU, or memory improvement claim: the deleted paths have no live callers. SQL/request/MAIN counts are expected to remain unchanged. The runtime check is one baseline-to-candidate pair of the frozen v3.1.4 real-Gateway workload, comparing causal warm-turn statements/requests/MAIN. Use --repetitions 1 --idle-seconds 0: the idle phase is omitted because this change removes unreachable code and makes no idle claim. Any added work attributed to a changed owner is a regression. This is count evidence, not a timing or CPU benchmark.

  • Two independent Codex review rounds: no actionable findings (the second covers only the mock-baseline follow-up).
  • Formatting and git diff --check: pass.
  • Exact source base df27c0c72d66 → candidate 5f1ff14ae825: production 42 → 31 symbols (29 exports + 13 types → 19 exports + 12 types), full-tree 57 → 52, scripts 0 → 0. No added findings in any lane; all other full-tree categories are unchanged. These count individual symbols, not compact-reporter rows. The frozen v3.1.4 pair passed on both revisions: ten causal warm turns each remain 45 [45–48] SQL / 11 [11–12] requests / 0 [0–0] MAIN. Whole workload: 2,821/762/96 → 2,820/757/96; these small aggregate changes are background variation, not claimed savings. Both fixtures completed restart and shutdown with no surviving children. Causal means are 45.6/11.2/0 → 45.3/11.1/0. Two raw execution windows exceed a 20% SQL increase: turn 02 is 46 → 61 and turn 03 is 47 → 65, while each causal turn stays 45/11/0. Raw windows include non-turn work; these increases are disclosed, not treated as a performance win or dismissed as within spread. This patch deletes unreachable paths and has no active SQL owner change. Attribution has an unchanged unknown bucket of 19 SQL / 17 requests, so the comparison is not complete attribution of every operation. The initial tool-search-path failure executed no Gateway workload; the corrected pair uses the mandated internal dependency store.
  • All eight affected suites pass (212 assertions). check:changed passed changed-file lint, Madge (zero runtime cycles), T1/dialect ratchets and architecture guards. Three UI max-lines findings are byte-identical to the base. Local tsrs setup rejects the mandated external-to-checkout internal dependency store, so exact-head CI supplies type proof. The two stale mock fingerprint rows were pruned by the canonical checker. Exact-head CI run 39838431952 completed successfully, including production/test types, lint, source contracts, architecture checks, ratchets and the required CI gate. Required checks are successful.
  • Completed all 86 originally discovered open-main PR overlap comparisons at exact heads. The fresh 2,936-PR census adds no new or moved overlapping heads; 85 compared heads remain open against main. Only fix: show recovery guidance for interrupted conversation startup #168211 and fix(auto-reply): skip heartbeat turns for legacy docs-link boilerplate scratch #158025 add conflicts; both exceptions were explicitly accepted. Every other comparison adds no conflict path or block. Details and per-PR results are below.

No SDK export removal or update/migration behavior change. Historical SDK removal records are retained.

Open-PR conflict comparisons

Freshness check (2026-10-22T19:39:03.696482+00:00): one open-main census covered 2,936 PRs. Reused unchanged-head file lists and inspected all 15 new + 18 moved heads from exact Git objects. None introduces a PR1 overlap (own #180915 excluded). Of the previous 86 compared PR heads, #180873 is no longer open against main; all remaining 85 overlap heads are unchanged, so their existing base df27c0c72d668515f397c2251914c1e9c0fc8f46 versus candidate 5f1ff14ae82597a74c2b05fe61382adc260d8487 comparisons remain applicable. No additional PR1 merge comparison was needed.

Coverage limit: unchanged non-overlap discovery reuses the prior complete file-list census (770 exact-head verified, 2,168 cached-only before this delta); this check does not independently refetch every unchanged cached-only head or cover activity after the snapshot. Leaving open-main does not establish whether a PR merged, closed, or changed base.

Open-PR overlap proof for 5f1ff14ae82597a74c2b05fe61382adc260d8487 against base df27c0c72d668515f397c2251914c1e9c0fc8f46:

A current-number census covered 2,938 open PRs targeting main. File discovery uses the repository-approved cache; 770 locally available heads were independently checked against Git. That check corrected one stale cached match. The remaining 2,168 discovery records were cached-only, so this is not a claim that every file list was independently verified.

All 86 discovered overlaps were then tested with exact commit objects (26 reused locally, 60 fetched and SHA-verified), recomputing their file paths before comparing base-only and candidate merge trees. Two cached matches (#158696 and #92649) no longer overlap the 15 changed files; their exact merge checks still add no conflicts. The other 84 are actual overlaps.

The only added conflict paths/blocks are these two accepted exceptions:

Every other discovered PR adds no conflict path or block. Changed inherited blocks in #160405 and #152205 only shrink as dead exports/implementation disappear. In #127967, existing drain conflict blocks coalesce (27 → 26 blocks), and the existing import conflict loses the dead export. The remaining conflict block content is unchanged.

PR Exact head Conflict paths, base → candidate Conflict blocks, base → candidate Result
#180873 e156630e88ff 0 → 0 0 → 0 No new conflict
#180867 8d49a9eaf2ea 0 → 0 0 → 0 No new conflict
#180828 5d12999c598c 0 → 0 0 → 0 No new conflict
#180539 b6d9c9c7fe76 0 → 0 0 → 0 No new conflict
#180233 07464c0ec811 0 → 0 0 → 0 No new conflict
#179363 c19837bc3077 3 → 3 4 → 4 No new conflict
#179194 2f4a743baa3d 1 → 1 1 → 1 No new conflict
#178962 fb8543938c58 0 → 0 0 → 0 No new conflict
#178581 813aa20c5879 1 → 1 1 → 1 No new conflict
#178483 aa3861021eb6 2 → 2 4 → 4 No new conflict
#178271 968b43208001 2 → 2 2 → 2 No new conflict
#177812 5cb29d92860b 2 → 2 2 → 2 No new conflict
#177356 987687d2da2c 0 → 0 0 → 0 No new conflict
#177351 4ba6e39ad497 14 → 14 21 → 21 No new conflict
#177190 cbc70ad22e24 3 → 3 1 → 1 No new conflict
#175600 48cc24b55d07 2 → 2 3 → 3 No new conflict
#175490 21c0134183a2 0 → 0 0 → 0 No new conflict
#174972 7557f309ff5c 3 → 3 6 → 6 No new conflict
#174943 5f9feb93c357 3 → 3 3 → 3 No new conflict
#172959 ee0cedaa76a8 0 → 0 0 → 0 No new conflict
#172313 90991bffa64d 5 → 5 7 → 7 No new conflict
#171189 5aed8180f8ba 9 → 9 16 → 16 No new conflict
#171128 93cf8c377780 7 → 7 9 → 9 No new conflict
#170165 723dca985334 1 → 1 6 → 6 No new conflict
#169868 9c6a8924938b 387 → 387 1043 → 1043 No new conflict
#169763 d9c110158fae 1113 → 1113 2128 → 2128 No new conflict
#169438 f6a9db4cd26a 67 → 67 119 → 119 No new conflict
#168615 7d79655895e7 76 → 76 176 → 176 No new conflict
#168211 59322816725f 3 → 4 3 → 4 Accepted exception
#167706 672c1e5ecdd1 9 → 9 13 → 13 No new conflict
#167703 18aebb9e5af2 87 → 87 208 → 208 No new conflict
#167529 daadcdfc8daa 0 → 0 0 → 0 No new conflict
#167292 ef89852e7e28 10 → 10 35 → 35 No new conflict
#167074 c795518d5955 32 → 32 54 → 54 No new conflict
#166965 ada9fd77acd7 3 → 3 11 → 11 No new conflict
#166488 b4840cdc61d8 6 → 6 15 → 15 No new conflict
#166166 834f58d1b5c9 126 → 126 179 → 179 No new conflict
#166140 c4709eecdda7 3 → 3 7 → 7 No new conflict
#166013 bcce26217e62 0 → 0 0 → 0 No new conflict
#166000 404210e057cd 5 → 5 6 → 6 No new conflict
#165824 20f0236c3d46 5 → 5 8 → 8 No new conflict
#165766 50e9a9a268dc 14 → 14 19 → 19 No new conflict
#165486 76a8560ec6f4 37 → 37 69 → 69 No new conflict
#164229 e7cfae3f6cb0 12 → 12 22 → 22 No new conflict
#163835 0c500450cbac 16 → 16 27 → 27 No new conflict
#163377 fef42420d6b3 3 → 3 7 → 7 No new conflict
#163267 977335c7ce62 2 → 2 2 → 2 No new conflict
#162287 ecf01c151961 23 → 23 38 → 38 No new conflict
#161339 7b46e593f73f 56 → 56 84 → 84 No new conflict
#160405 1215c55d8b06 9 → 9 15 → 15 No new conflict
#160332 9a12233c54f6 1 → 1 1 → 1 No new conflict
#160275 efef44c34388 26 → 26 65 → 65 No new conflict
#159956 2b9ad24c33f3 2 → 2 5 → 5 No new conflict
#159478 5b5b64e51834 21 → 21 38 → 38 No new conflict
#158723 69dc6bf27a16 28 → 28 69 → 69 No new conflict
#158696 03968fb877d0 0 → 0 0 → 0 Cached false positive; no new conflict
#158030 3ef0f9d0e60d 29 → 29 48 → 48 No new conflict
#158025 9f80c66ddfa0 1 → 2 1 → 2 Accepted exception
#157679 5120627c92e0 18 → 18 29 → 29 No new conflict
#156344 39df3ce2284f 25 → 25 74 → 74 No new conflict
#152372 6dd236464bcc 6 → 6 11 → 11 No new conflict
#152205 24ff19f9bda8 582 → 582 1378 → 1378 No new conflict
#150479 64fb787aa001 28 → 28 44 → 44 No new conflict
#149906 cc51ef141742 8 → 8 8 → 8 No new conflict
#149241 d72b1321b187 2 → 2 2 → 2 No new conflict
#147932 8d72643069ba 3 → 3 6 → 6 No new conflict
#147886 cf24913fc0e9 5 → 5 7 → 7 No new conflict
#147026 7fc00dbca054 5 → 5 14 → 14 No new conflict
#145895 49da58a3deb7 0 → 0 0 → 0 No new conflict
#144065 590c6fe105a8 6 → 6 16 → 16 No new conflict
#140609 3cfefcf012dd 4 → 4 8 → 8 No new conflict
#140423 af7a65630e2f 2 → 2 2 → 2 No new conflict
#137594 7184fe41ff26 10 → 10 17 → 17 No new conflict
#137435 8a3772bab3c9 3 → 3 6 → 6 No new conflict
#137348 e0655575513a 2 → 2 2 → 2 No new conflict
#136554 a463b3e143e7 15 → 15 23 → 23 No new conflict
#136274 dbb2c552294f 0 → 0 0 → 0 No new conflict
#135296 ac101e3c89e6 4 → 4 6 → 6 No new conflict
#129388 f4675cff003d 232 → 232 492 → 492 No new conflict
#127967 4d3b1169f3f1 13 → 13 27 → 26 No new conflict
#126924 1c08b63c1b82 28 → 28 75 → 75 No new conflict
#124557 6d2ee6a23772 8 → 8 8 → 8 No new conflict
#124337 2407313ae051 0 → 0 0 → 0 No new conflict
#118359 c0b565dab768 4 → 4 8 → 8 No new conflict
#92649 026efed04ae3 3 → 3 5 → 5 Cached false positive; no new conflict
#89526 d679aa897825 0 → 0 0 → 0 No new conflict

The proactive heartbeat executor and old queue activation caller have already been retired. Remove their unused helpers and stale mock keys while keeping queue recovery assertions on scheduleFollowupDrain and retaining the public system-event shape.
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 22, 2026
@steipete
steipete marked this pull request as ready for review October 22, 2026 19:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T19:17:51.366198Z 5f1ff14 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 47c1380 into main Oct 22, 2026
171 of 173 checks passed
@steipete
steipete deleted the dbasync/knipclean branch October 22, 2026 19:41
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
Remove unreachable helpers left by heartbeat executor retirement and the old queue activation path. Preserve the current heartbeat response handling, public system-event shape, and restart recovery through scheduleFollowupDrain.

Delete the superseded implementations, obsolete unit cases, and stale mock exports. Net reduction: 183 lines. No schema, SQL, dependency, or public Plugin SDK change.

Co-authored-by: Dave Lauer <dlauer@gmail.com>
Co-authored-by: JustYannicc <52761674+JustYannicc@users.noreply.github.com>
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant