Repository navigation
improve: speed up SQLite reads on Node 24.20 - #149769
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: needs maintainer review before merge. Reviewed September 16, 2026, 2:31 AM ET / 06:31 UTC (Revision 2). ClawSweeper reviewWhat this changesEnable faster native SQLite result collection on Node 24.20 and later Node 24 releases while retaining the existing fallback on older runtimes and Bun. Merge readiness✅ Ready for maintainer review Keep open: the optimization remains absent from current main, and the narrow runtime gate matches Node’s backported fix. No actionable correctness or security findings remain. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s synchronous SQLite executor turns compiled database queries and bound parameters into result rows for storage consumers such as session history. This change selects the native result collector without changing query construction or database lifecycle ownership. flowchart TD
A[Storage queries and parameters] --> B[Shared SQLite executor]
B --> C[Existing statement cache]
C --> D{Supported native collector?}
D -->|Yes| E[Native bulk read]
D -->|No| F[Iterator collection]
E --> G[Result rows]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1. Total -1 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep runtime selection inside the shared executor and use native collection only on Node releases with the reprepare fix. Do we have a high-confidence way to reproduce the issue? Not applicable as a correctness bug: this is a performance optimization, supported by source-confirmed path selection and reported paired real-runtime measurements. Is this the best way to solve the issue? Yes. Extending the existing version gate is the narrowest solution and preserves established query, caching, fallback, and lifecycle contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7141bded36b3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Related: #147862
What Problem This Solves
SQLite reads on Node 24.20 still build their result arrays through JavaScript iteration even though that release includes the native bulk-read correctness fix.
User Impact
Reduces warm SQLite result-read overhead on Node 24.20 and later Node 24 releases. Older Node 24 releases retain the existing safe fallback; the minimum supported Node version is unchanged.
Why This Change Was Made
Extend the existing
all()eligibility check to the Node 24.20 backport. The upstream implementation obtains column counts after stepping, so cached queries preserve newly added columns after SQLite reprepares them. Native statement ownership, bindings, error handling, lazy iteration, and transactions remain with their existing owners.Evidence
iterate()toall(). All 12 handles closed.Formatting, diff checks, and targeted type-aware lint passed. Independent review found no actionable findings through P2. Exact-head hosted CI 35061297642 passed, including required
openclaw/ci-gate. Completed independent and ClawSweeper reviews have no actionable findings; native landing checks remain authoritative.