You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update-graph.sh hook fallback silently no-ops when dist/cli.js hasn't been built yet #2074
Found while investigating a Greptile P2 comment on PR #1980.
The issue:.claude/hooks/update-graph.sh's fallback branch (used when the codegraph binary isn't on PATH) now correctly points at dist/cli.js (fixed by #1980, which corrected a stale src/cli.js reference). But on a genuinely fresh checkout — before npm run build has ever run — dist/cli.js doesn't exist yet either. Since stderr is redirected to /dev/null and the exit code is swallowed (2>/dev/null && BUILD_OK=1 || true), the hook silently no-ops with no visible error, identical in symptom to the bug #1980 fixed (graph never rebuilds, contributor gets no feedback).
Why this is separate from #1980:#1980's fix is complete and correct for its stated scope (pointing the fallback at the right file once built). This is a narrower, pre-existing edge case — the hook's own header comment states it's "informational only, never blocks," so some silent-failure tolerance is by design. The specific gap is diagnosability: a contributor with a fresh clone gets no signal that they need to run npm install/npm run build first.
Suggested fix: before invoking node .../dist/cli.js, check whether the file exists; if not, either skip with a one-line hint (e.g. echo "[codegraph] run npm run build to enable graph auto-rebuild" >&2, still non-blocking) or fall back further. Should also cover the case where node_modules/better-sqlite3 native bindings aren't installed yet.
Activity
fix(hooks): surface build failures in update-graph.sh instead of sile…
fix(docs): update-graph.sh template surfaces build failures, not /dev…
fix(skills): fixer step 2g defends against a moved queue head (#2467)