Fix node:sqlite V8 crash on invalid UTF-8 in text columns (#272)

node:sqlite calls v8::String::NewFromUtf8 with kAbort on TEXT columns.
Cursor chat blobs often contain truncated multi-byte chars from streaming
boundaries, which triggers a V8 CHECK abort (not a JS exception).

Select all text-content columns as CAST(col AS BLOB) so node:sqlite
returns Uint8Array instead. Decode in JS with TextDecoder fatal:false
which replaces bad bytes with U+FFFD. Covers all three SQLite providers
(Cursor, Goose, OpenCode).

Removes the version blocklist (MIN_NODE_22_PATCH) and lowers engines
requirement from >=22.20 to >=22 since the BLOB cast approach works
on all Node 22.x versions.

Closes #264
Closes #250
This commit is contained in:
Resham Joshi 2026-05-10 17:05:08 -07:00 committed by GitHub
parent d142bd97ef
commit 02f4635cec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 101 additions and 76 deletions

View file

@ -30,7 +30,7 @@
"developer-tools"
],
"engines": {
"node": ">=22.20"
"node": ">=22"
},
"author": "AgentSeal <hello@agentseal.org>",
"license": "MIT",