Skip to content

fix(daemon): bump better-sqlite3 to ^12 and unpin Node 24 in CI - #1104

Merged
kumavis merged 3 commits into
llmfrom
break/daemon-better-sqlite3-12
Sep 1, 2026
Merged

fix(daemon): bump better-sqlite3 to ^12 and unpin Node 24 in CI#1104
kumavis merged 3 commits into
llmfrom
break/daemon-better-sqlite3-12

Conversation

@kumavis

@kumavis kumavis commented Sep 1, 2026

Copy link
Copy Markdown
Member

Broken out of feat/hosted-endo-management.

Description

better-sqlite3@11 uses the legacy node::ObjectWrap cleanup pattern; when its Database/Statement finalizers run after the Node environment is torn down, node::RemoveEnvironmentCleanupHook hits Assertion failed: (env) != nullptr and aborts the process. Node 24.19 changed teardown ordering in a way that triggers this (nodejs/node#65042); 12.x fixed the cleanup-hook lifecycle upstream.

CI already knows about this bug: the matrix is pinned to Node 24.18.0 as a "temporary" workaround (a59021f8a). This PR takes the root fix instead — bump @endo/daemon to better-sqlite3 ^12 and un-pin all four matrix entries back to 24.x. No other workspace depends on better-sqlite3, so the lockfile drops 11.x entirely.

On the branch this was reproduced on Node 24.19.0: the daemon persistence/restart tests failed 7 of 8 iterations on 11.10.0 (a restarted daemon aborts between binding its socket and sending its ready IPC) and pass 8 of 8 on 12.11.1.

Security Considerations

None — a native dependency patch-level lifecycle fix; no API or authority changes.

Scaling Considerations

None.

Documentation Considerations

None; no user-visible behavior change.

Testing Considerations

Validated here: @endo/daemon lint clean (0 errors, warning count identical to llm baseline). The behavioral difference only manifests on Node ≥ 24.19, which CI's re-widened 24.x legs will now exercise.

Compatibility Considerations

better-sqlite3 12 requires Node ≥ 20, which the repo already exceeds.

Upgrade Considerations

None; the SQLite file format is unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s


Generated by Claude Code

better-sqlite3@11 aborts Node 24 processes with "Assertion failed:
(env) != nullptr" in node::RemoveEnvironmentCleanupHook when Statement
or Database finalizers run against a torn-down environment. That hits
this package on two surfaces:

- The daemon process itself: a restarted daemon can abort between
  binding its socket and sending its ready IPC message, so start()
  rejects with "Daemon failed to spawn ... exited null". On the Node 24
  CI leg this failed the persistence tests (store pass-copy values,
  persist spawn and evaluation, rehydrated requests can be resolved
  after restart) with each crashed daemon's abort trace landing only in
  its endo.log.
- The AVA worker: endo.test.js opens in-process Database handles via
  openTestDb for db-inspection assertions; their finalizers abort the
  test process at teardown, before AVA prints its failure summary
  (turbo then reports the task failed with exit 129 and no detail).

Reproduced on Node 24.19.0, the CI toolchain version: the three restart
tests failed 7 of 8 iterations with 11.10.0 and pass 8 of 8 with
12.11.1, which fixed the cleanup-hook lifecycle upstream. Node 22 is
unaffected. No other workspace depends on better-sqlite3, so the lockfile drops
11.x entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuRefk7nt9vH96nfxcQcNP
(cherry picked from commit a53d20e)
The matrix pinned Node to 24.18.0 because Node 24.19 triggers the
better-sqlite3@11.10.0 legacy node::ObjectWrap cleanup abort
(nodejs/node#65042). With @endo/daemon on better-sqlite3 ^12, which
fixed the cleanup-hook lifecycle upstream, the pin is no longer needed;
track the 24.x line again.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
@kumavis
kumavis merged commit 24a7ce4 into llm Sep 1, 2026
25 checks passed
@kumavis
kumavis deleted the break/daemon-better-sqlite3-12 branch September 1, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants