Skip to content

refactor(plugins): remove redundant native timer method probes - #193309

Merged
steipete merged 1 commit into
mainfrom
dbasync/dpoptional4
Nov 5, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/dpoptional4

Conversation

@steipete

@steipete steipete commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bundled realtime voice and messaging plugins still probe whether native Node/Bun timer handles provide unref, immediately after allocating those handles.

User Impact

No user-visible behavior change. Deadlines, cancellation, cleanup, authority checks, and timer handles remain unchanged.

Why This Change Was Made

Call the guaranteed native method at allocation and remove the redundant probes. This removes 25 optional method checks across 19 files, including three otherwise-unused local bindings. Production delta: +27/-53 (net -26); test delta: 0. No SQL, schema, worker routing, SDK type, provider request, or configuration changes.

Security-sensitive timers keep their existing checks: FaceTime still closes unauthenticated sockets; voice-call still limits pending connections and closes unstarted streams; realtime delegation still checks claim/active ownership; Synology still aborts timed-out requests and holds the response slot until completion. The timeout callbacks and their existing guards are byte-for-byte unchanged apart from the allocation expression.

Evidence

Acceptance rule, recorded before measurement: the 25 redundant method checks disappear; native timer identity, callbacks, cancellation and deadlines stay equivalent. Owning behavior suites and type-aware lint/format must pass; exact-head CI must introduce no static or behavioral regression. Test LOC must not increase.

SQL-inert census waiver applies. One frozen v3.1.5 baseline/candidate count pair is running on pinned commits; its warm statements, worker requests and runtime MAIN will be added after landing under the campaign post-merge measurement rule. No SQL or latency improvement is claimed. Any attributed regression requires correction. No wall-clock/CPU A/B measurement is planned.

Validation: pinned changed-file oxfmt and plain oxlint pass; git diff --check passes. Two isolated Codex reviews of the complete 19-file patch are scoped-clean through P2. They reviewed the diff and native contract; repository-specific timer mocks are covered by 18 existing focused owner suites: all 294 tests passed in five Vitest groups. Type-aware wrapper preparation stops before analysis because the mandated external virtual-store location fails declaration containment; that guard is intact. Exact-head CI 41992143349 passed all selected checks, including typed/static proof and the required aggregate gate.

Open-PR comparison at the indexed peer heads: #192698, #192343, #187432, #178262, #175940, #172448, #170000, #165147, #159147, #158392, #157860, #155491, #154498, #141237, #137895, #136506. Each base-only vs candidate git merge-tree comparison has identical conflict-path counts and no changed conflict blocks in the touched files. Final discovery confirmed all 16 indexed peer heads unchanged before landing.

The simplification pass kept only the native timer method changes; no new abstractions, types, tests, exports, or configuration. All sites predate October 25, so this is deferred cleanup rather than a claim of newly introduced code.

Post-merge count evidence

Frozen v3.1.5 same-platform baseline/candidate pair completed on the pinned PR base and head. Both full workloads, including restart, passed. Ten causal warm turns per side: statements median 49 / p95 52 [49–52] on both; requests median 14 / p95 15 [14–15] on both; runtime MAIN 0 on both.

Whole-workload SQL/requests/MAIN were 2996/798/105 → 3022/811/106. The additional MAIN statement is a cold-start PRAGMA busy_timeout = 5000 restoration: the candidate cold admission used 4999 ms instead of 5000 ms, so the unchanged runWithSqliteBusyTimeout owner restored it. No runtime MAIN increase. Other raw deltas belong to unchanged background/deletion/snapshot/cron work; the complete per-operation delta is retained with the campaign evidence. None of the 19 changed timer owners issues a changed SQL operation. No latency, SQL-saving, or whole-workload reduction claim is made.

Whole-workload per-operation deltas (SQL / requests / MAIN)
Operation Baseline Candidate
AsyncLocalStorage.enterAsyncStore 0/19/0 0/20/0
NO_REQUEST / AsyncLocalStorage.enterAsyncStore 14/0/0 21/0/0
NO_REQUEST / native lifecycle 80/0/8 81/0/9
agentDatabaseDeletion.snapshot 37/8/0 48/10/0
index-read 6/5/0 8/7/0
lifecycle-artifact-plan 9/2/0 8/2/0
loadCronRows 3/3/0 5/5/0
loadMemorySourceFileState 4/4/0 2/2/0
pluginState.loadNamespace 6/6/0 8/8/0
prewarm 0/2/0 0/3/0
scan 0/5/0 0/6/0
session-entry-list 20/6/0 24/7/0
session-exact-entries 40/22/0 37/22/0
session-target-inventory 2/10/0 2/12/0
session-transcript-instances 2/1/0 7/2/0
usage-cost 30/5/0 28/5/0

@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T08:09:49.743380Z 8d7de2a PR opened
ℹ️ 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 cde63dd into main Nov 5, 2026
119 of 123 checks passed
@steipete
steipete deleted the dbasync/dpoptional4 branch November 5, 2026 08:17
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
…law#193309)

Remove 25 redundant optional method probes on freshly allocated native timer handles across bundled voice and messaging plugins. Preserve callbacks, deadlines, cancellation, authority checks, and cleanup.

Validation: 294 focused tests passed; two isolated reviews; exact-head CI passed. Production net -26 lines; no test changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant