Skip to content

fix(server): sqlite v13 on Bun+Node, Daytona toolchain, and v0.18.15 version backfill - #3563

Merged
reachjalil merged 2 commits into
devfrom
fix/sqlite-bun-daytona
Aug 5, 2026
Merged

fix(server): sqlite v13 on Bun+Node, Daytona toolchain, and v0.18.15 version backfill#3563
reachjalil merged 2 commits into
devfrom
fix/sqlite-bun-daytona

Conversation

@reachjalil

@reachjalil reachjalil commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

One PR to bring dev fully level for v0.18.16. Combines the sqlite runtime fixes with the v0.18.15 version backfill (#3562 closed in favor of this).

Commit 1 — sqlite v13 fixes (the regressions #3561 introduced)

  1. Bun panic — v13's N-API binding hard-crashes Bun (NAPI FATAL ERROR: Error::New napi_get_last_error_info); bun test died suite-wide, and the Daytona worker runtime ships openwork-server as a bun-compiled binary, so runtime sandboxes would crash too. opencode-db now picks its driver lazily at call time: bun:sqlite under Bun, better-sqlite3 under Node/Electron (same API surface; the test fixture already used bun:sqlite).
  2. Latent Node bug bun-CI can't see — v13 under Node rejects ?N numbered params bound positionally (RangeError: Too many parameter values were provided); bun:sqlite accepts them, so tests stayed green while the desktop/Node path would break. All statements normalized to anonymous ?, verified against both drivers.
  3. Daytona snapshot build — pnpm's implicit node-gyp build compiles better-sqlite3 from source in node:22-bookworm-slim (no toolchain): gyp ERR! Could not find any Python installation. Builder stage now installs python3 make g++.

Commit 2 — v0.18.15 version backfill

The bump commit the v0.18.15 tag was cut from (tag-ruleset admin bypass): apps/app, apps/desktop, apps/server package.json + regenerated ee/apps/den-api/src/generated/desktop-versions.ts. Merging keeps dev's version math correct for the next release.

Verification

  • bun test in apps/server: 625 pass (panic reproduced on unpatched dev with the same suite)
  • bun test src/opencode-db.test.ts: 5/5, availability-skip removed
  • Node smoke of every statement shape against better-sqlite3 v13, including the arg-order-sensitive update
  • v0.18.15 run validated the electron matrix on v13: 16/18 green incl. all Linux variants (only Daytona red — fixed here)

After merge, v0.18.16 gets tagged from dev and the release publishes end-to-end.

🤖 Generated with Claude Code

…sqlite3 v13

The v13 convergence (#3561) broke three things this fixes:

1. better-sqlite3 v13's N-API binding hard-panics Bun (NAPI FATAL ERROR:
   Error::New napi_get_last_error_info) - and bun test loads it via
   opencode-db's top-level import, killing the whole server suite. The
   Daytona worker runtime also ships openwork-server as a bun-compiled
   binary, so the panic would hit production sandboxes at runtime.
   opencode-db now selects its driver lazily at call time: bun:sqlite
   under Bun, better-sqlite3 under Node/Electron.

2. v13 under Node rejects ?N numbered parameters bound positionally
   (RangeError: Too many parameter values were provided) - bun:sqlite
   accepts them, so bun-driven CI could never catch it. All statements
   now use anonymous ? placeholders, verified on both drivers.

3. The Daytona snapshot image build compiles better-sqlite3 from source
   (pnpm's implicit node-gyp build for packages with a binding.gyp) and
   node:22-bookworm-slim has no toolchain: "gyp ERR! Could not find any
   Python installation". Add python3/make/g++ to the builder stage.

Verified locally: bun test apps/server green (panic reproduced on
unpatched dev), node smoke of every statement shape against v13.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 5, 2026 1:17pm
openwork-den Ready Ready Preview Aug 5, 2026 1:17pm
openwork-den-worker-proxy Ready Ready Preview Aug 5, 2026 1:17pm
openwork-landing Ready Ready Preview, v0 Aug 5, 2026 1:17pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
openwork-diagnostics Skipped Skipped Aug 5, 2026 1:17pm

@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics August 5, 2026 13:15 Inactive
@reachjalil reachjalil changed the title fix(server): make opencode-db work on both Bun and Node under better-sqlite3 v13 fix(server): sqlite v13 on Bun+Node, Daytona toolchain, and v0.18.15 version backfill Aug 5, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (3168c5b120988bb5e1e8daa15653eba65cb0382c). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit daf1ce6 into dev Aug 5, 2026
26 checks passed
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.

1 participant