Repository navigation
fix(node:sqlite): publish query diagnostics - #212
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
October 26, 2026 04:50
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. |
steipete
added a commit
to openclaw/openclaw
that referenced
this pull request
Oct 26, 2026
Capture SQLite query metadata before execution cleanup finalizes the statement. Keep one latest metadata snapshot per statement so history selectivity, bounded metadata reads, and nested anchor assertions remain unchanged. Verified the original four failures on Node 26.12.1 and Bun with real disposal, then all four passing on both plus the baseline Bun revision. The 16-file session/cache/worker matrix passes on all three runtimes. No production use-after-dispose was found. Codex autoreview is clean. Related: openclaw/bun#212
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 27, 2026
…aw#185103) Capture SQLite query metadata before execution cleanup finalizes the statement. Keep one latest metadata snapshot per statement so history selectivity, bounded metadata reads, and nested anchor assertions remain unchanged. Verified the original four failures on Node 26.12.1 and Bun with real disposal, then all four passing on both plus the baseline Bun revision. The 16-file session/cache/worker matrix passes on all three runtimes. No production use-after-dispose was found. Codex autoreview is clean. Related: openclaw/bun#212
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The runtime reports Node 26.12.1 but did not publish
sqlite.db.query. Consumers consequently enabled Node-version-gated diagnostics without receiving the event, including OpenClaw's same-query schema-read reentry test.Publish through the public diagnostics channel from SQLite's native profile callback. Events are synchronous, including nested queries, with a null-prototype
{ sql, database, duration }payload: expanded SQL (source fallback), the exact database object and SQLite's nanosecond duration estimate. Subscriber transitions enable/disable tracing; prepare and partial iteration emit nothing, and finalization/GC suppresses events. Subscribers retain responsibility for bounding their own recursive instrumentation, matching Node.Keep active statements guarded through cleanup resets, reject closing busy statements from authorizer callbacks, and preserve database/publisher lifetime and pending query errors during nested reads. Initialize the lazy next-tick function when tracing activates so stack-overflow errors retain the public channel's asynchronous delivery. Add the current constructor aliases and statement close/disposal support used by Node's unchanged feature tests.
Validation:
RangeErrordelivery, failed-query cleanup, authorizer safety and subscription transitions.src/infra/sqlite-schema-contract.test.tsat77d0f72273cb1aaeb21e8e84e6e0742d14de2c03: published S8 24 pass / 1 fail; final patched production build 25 pass / 0 fail / no skips, using isolated HOME/state andOPENCLAW_BUN_PATH.f5e7fda70b22f27dda67ff59493037d0ef043b91; the CI merge commit has exactly the same source tree. Format, source lint and JavaScript lint/typecheck also passed.Linux production ThinLTO cost, ten alternating S8/patched pairs pinned to one CPU, 200,000 warmups and 5,000,000 measured prepared
SELECT 42 AS answercalls per process:Every subscribed run verified 5,000,000 events and correct SQL/database identity; all runs verified query results. No timing retries. The small unsubscribed difference is within normal noise, not claimed as a speedup. Baseline is published S8 at
5534724c02; final patched head isf5e7fda70b22f27dda67ff59493037d0ef043b91.Reference: Node profile callback, subscriber transitions, and unchanged upstream tests. Upstream Bun searches found no matching diagnostics producer to port.