Originally created by: adityaharishch
In local dev, the Tasks → Sync button failed with Sync failed: tasks-sync: open db: failed to run migrations.
Root cause is a dev-only binary mismatch:
dev-start.sh runs the daemon as cargo watch -x 'run --bin meridian' → target/debug/meridian. That build is rebuilt on every save and migrates meridian.db forward as new migrations land./api/tasks/sync, OAuth, triage) resolved a separately-installed binary under ~/.meridian/app/bin/meridian via selectMeridianBinary(meridianCandidates()). That artifact does not track the repo.So the instant a migration was added, the daemon advanced the DB while the installed CLI stayed behind, and sqlx refused to open the ahead-of-it DB — surfacing as the opaque "failed to run migrations".
Make meridianCandidates() environment-aware:
NODE_ENV === 'development' (npm run dev): prepend <repo>/target/debug/meridian then target/release/meridian ahead of the installed paths (next dev runs with cwd = <repo>/ui, so repo root is one level up). The UI now shells out to the same binary the daemon runs — they can't drift.NODE_ENV !== 'development'): unchanged — installed-only, native-first, preserving the launchd PATH-parity guarantee from the original env: node: No such file or directory fix.Also: print the full anyhow source chain ({e:#}) on tasks-sync open-db failure so the real sqlx cause is visible next time instead of the top-level context (src/main.rs).
ui/__tests__/meridian-bin.test.ts: repo build prepended, debug-before-release, node wrapper still last, production no-op.selectMeridianBinary tests to 'production' for determinism.bun test → 12 pass / 0 fail; UI build clean; full pre-push suite passed.🤖 Generated with Claude Code
Originally posted by: Akarsh-Hegde
🔍 Code review — resolve meridian binary to repo build in dev
High-effort pass, verified against source. Clean — no bugs found. Nice fix for a real dev/prod drift trap.
The change adds an
env/cwd-parameterised dev branch tomeridianCandidates(): underNODE_ENV === 'development'it prependstarget/debug/meridianthentarget/release/meridianahead of the installed paths, so the dashboard shells out to the same binarycargo watchruns — closing the window where a freshly-added migration advancesmeridian.dbpast what the installed CLI knows, and sqlx aborts task-sync with the opaque "failed to run migrations".What I checked:
env !== 'development'(incl.undefined) returns the installed-only list unchanged. ✅resolve(cwd, '..')assumescwd = <repo>/ui; if it isn't, the prependedtarget/*paths simply aren't executable andselectMeridianBinaryskips them. No crash, falls through to installed. ✅'still lists the node wrapper last'guards it.main.rs{e:#}correctly prints the full anyhow source chain (the sqlx migration cause) instead of just the top-level context — directly useful for the drift this PR targets.'production').LGTM.
🤖 Assisted review via Claude Code.
Ticket changed by: adityaharishch
Originally posted by: adityaharishch
🎉 This PR is included in version 1.53.1 🎉
The release is available on:
v1.53.1Your semantic-release bot 📦🚀