From 70c91f8afdde4581098d03c7edf53837d48c57ba Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 10 Apr 2026 13:59:41 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20chore:=20Correct=20lbug-adapter?= =?UTF-8?q?=20Path=20for=20GitNexus=20Vector=20Extension=20Patch=20(#12609?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The published gitnexus npm package compiles pool-adapter.ts to dist/mcp/core/lbug-adapter.js, not dist/core/lbug/pool-adapter.js as I guessed in the previous PR. The sed patch failed the Docker build because the target file didn't exist. Point the patch at the correct compiled path and add a grep -c verification after sed to confirm the replacement actually landed. --- .fly/gitnexus/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.fly/gitnexus/Dockerfile b/.fly/gitnexus/Dockerfile index 6a3a8c6118..3362eb658d 100644 --- a/.fly/gitnexus/Dockerfile +++ b/.fly/gitnexus/Dockerfile @@ -26,13 +26,16 @@ RUN echo "deb http://deb.debian.org/debian trixie main" > /etc/apt/sources.list. COPY install-extensions.js /tmp/install-extensions.js RUN node /tmp/install-extensions.js && rm -rf /tmp/install-extensions.js /tmp/lbug-ext-install -# 4. Patch pool-adapter.js to also LOAD EXTENSION vector after FTS. +# 4. Patch mcp/core/lbug-adapter.js to also LOAD EXTENSION vector after FTS. # Upstream only loads FTS at serve time; without vector extension # loaded, semantic search's CALL QUERY_VECTOR_INDEX fails silently. -RUN POOL_ADAPTER=/usr/local/lib/node_modules/gitnexus/dist/core/lbug/pool-adapter.js \ - && grep -q "LOAD EXTENSION fts" "$POOL_ADAPTER" \ - && sed -i "s|await available\[0\]\.query('LOAD EXTENSION fts');|await available[0].query('LOAD EXTENSION fts'); try { await available[0].query('LOAD EXTENSION vector'); } catch (e) { /* vector extension may not be installed */ }|g" "$POOL_ADAPTER" \ - && echo "pool-adapter.js patched to load vector extension" +# Note: the published npm package compiles the source pool-adapter.ts +# to dist/mcp/core/lbug-adapter.js (not a 'pool-adapter.js' file). +RUN LBUG_ADAPTER=/usr/local/lib/node_modules/gitnexus/dist/mcp/core/lbug-adapter.js \ + && grep -q "LOAD EXTENSION fts" "$LBUG_ADAPTER" \ + && sed -i "s|await available\[0\]\.query('LOAD EXTENSION fts');|await available[0].query('LOAD EXTENSION fts'); try { await available[0].query('LOAD EXTENSION vector'); } catch (e) { /* vector extension may not be installed */ }|g" "$LBUG_ADAPTER" \ + && grep -c "LOAD EXTENSION vector" "$LBUG_ADAPTER" \ + && echo "lbug-adapter.js patched to load vector extension" # Copy pre-built GitNexus indexes (one per branch) and register each. # The directory name becomes the repo name in `list_repos` output, so