Skip to content

chore(pgvector-embedded): rebuild prebuilt artifacts (v0.8.1)#977

Closed
github-actions[bot] wants to merge 8 commits into
mainfrom
chore/pgvector-embedded-v0.8.1-26182530484
Closed

chore(pgvector-embedded): rebuild prebuilt artifacts (v0.8.1)#977
github-actions[bot] wants to merge 8 commits into
mainfrom
chore/pgvector-embedded-v0.8.1-26182530484

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 20, 2026

Regenerated by the build-pgvector-embedded workflow (pgvector v0.8.1, PG 18).

Summary by CodeRabbit

Release Notes

  • New Features
    • Connectors can now declare native system dependencies (via Nix packages) required at runtime.
    • CLI supports local TypeScript connector compilation during deployment.
    • Project initialization includes connector scaffolding with dependency management setup.

Review Change Stack

buremba and others added 8 commits May 20, 2026 19:37
Foundation for user-declared connector dependencies:

- SDK: add `runtime.nix.packages` to ConnectorRuntimeInfo so a connector
  declares its native (nixpkgs) tools; rides the existing `runtime` JSONB,
  no migration. npm deps are bundled at compile time and don't go here.
- Compile: externalize `@lobu/connector-sdk` (+ `lobu` alias) instead of
  bundling it. The SDK pulls a large infra graph (Sentry/OTel/grpc/git)
  transitively, inflating every connector to multiple MB; the runtime
  provides the SDK (it's a connector-worker dep), so the bundle leaves it
  as a runtime-resolved import — the standard externalize-the-framework
  pattern. Bundles drop from ~MB to the connector's own code + deps.
  Also emit an inline source map (sourcesContent:false) for stack traces.
- Executor: when a connector declares nix packages, wrap the child in
  `nix-shell -p <pkgs> --run "exec node ..."` so the tools are on PATH;
  `exec` preserves the IPC channel and kill semantics. Plain fork() stays
  the path when no packages are declared. Fail with a clear actionable
  error when nix-shell is absent but packages are required.
Threads a connector's declared native packages from storage to the
executor so they're on PATH during a run:

- worker-api poll: join connector_definitions and surface its `runtime`,
  emitting `nix_packages` in the poll response (the `runtime.nix.packages`
  the SDK extraction already persists in the existing runtime JSONB — no
  storage change needed).
- daemon: carry `nix_packages` on PollResponse and pass it through the
  three executeCompiledConnector call sites (sync/action/auth).
- executeCompiledConnector: forward `nixPackages` to executor.execute,
  which wraps the child in nix-shell when non-empty.

Connectors that declare no native deps are unaffected (plain fork path).
…ckaging

Connector npm deps now work in the apply→cloud path:

- apply: project-supplied connectors are compiled on the CLI (the only
  place the project's node_modules exists, so esbuild can bundle the
  connector's declared deps) and uploaded as a pre-compiled bundle
  (`compiled: true`); the server stores the artifact instead of
  recompiling source it can't resolve deps for.
- ensure-deps-installed: runs `bun install --ignore-scripts` in the
  connector's project (resolved via the nearest `lobu.toml`, so a
  connector inside a monorepo never installs the wrong root); no-ops when
  the project declares no package.json.
- client.installConnector gains a `compiled` flag.
- lobu init scaffolds package.json (with @lobu/connector-sdk devDependency
  for editor types) + tsconfig.json + connectors/.
- AGENTS.md documents the convention: npm = bundled at compile, native =
  nix at run time; SDK is runtime-provided/externalized.
Keep esbuild + connector-worker + SDK out of apply-cmd's module-load path
(only `lobu apply` with local *.connector.ts needs it). Documented in the
AGENTS.md dynamic-import allow-list. Matches connector-run-cmd's pattern.
…oin, init merge

- apply: compile `def.sourcePath` (the actual `.ts`) for local connectors, not
  `def.sourceFile` (an error-message label that may point at a `type: connector`
  YAML). `source_url` connectors (source fetched into `sourceCode`, no local
  deps) upload raw for gateway compile instead of being compiled locally.
- worker-api: filter the connector_definitions join to `status = 'active'` so it
  matches the partial unique index `idx_connector_defs_org_key` — archived/draft
  rows share `(key, org)` and made the runtime lookup nondeterministic.
- init: merge into an existing `package.json` (preserve the user's fields, add
  the SDK devDependency) and never overwrite an existing `tsconfig.json`, so
  `--here` into an existing project is non-destructive.
- docs: note `bun install --ignore-scripts` (the actual command).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

This PR adds local connector compilation during lobu apply, project scaffolding for new connector authoring, and runtime system dependencies (nix packages) that wrap connector execution. The CLI now compiles .connector.ts sources on-demand, the compiler externalizes the SDK for cleaner bundling, and the worker daemon conditionally wraps executor processes in nix-shell when system packages are declared.

Changes

Local Connector Compilation with Runtime Nix Dependencies

Layer / File(s) Summary
Runtime metadata schema
packages/connector-sdk/src/connector-types.ts
ConnectorRuntimeInfo adds optional nix?: { packages: string[] } field to declare native system dependencies.
Project scaffolding on init
packages/cli/src/commands/init.ts
New connector projects receive package.json (with @lobu/connector-sdk devDependency), tsconfig.json, and connectors/ directory.
Dependency management utility
packages/cli/src/commands/_lib/ensure-deps-installed.ts
New module walks upward from connector source to locate project root, detects stale installs via mtime comparison, and runs bun install --ignore-scripts when needed.
CLI local compilation and installation
packages/cli/src/commands/_lib/apply/apply-cmd.ts, packages/cli/src/commands/_lib/apply/client.ts
When applying a connector with sourcePath, CLI dynamically imports helpers, ensures project deps, compiles the .ts file, and installs via ApplyClient.installConnector with compiled: true flag.
Compiler SDK externalization
packages/connector-worker/src/compile/index.ts
Esbuild plugin externalizes @lobu/connector-sdk and lobu imports; removes SDK-entry override option; switches to inline source maps without embedded content.
Worker poll response with connector metadata
packages/server/src/worker-api.ts, packages/connector-worker/src/daemon/client.ts
Server LEFT JOINs connector_definitions to fetch runtime metadata; worker includes nix_packages field in poll response; daemon client type updated.
Executor nix-shell wrapping and configuration
packages/connector-worker/src/executor/interface.ts, packages/connector-worker/src/executor/runtime.ts, packages/connector-worker/src/executor/subprocess.ts, packages/connector-worker/src/daemon/executor.ts
Executor interface declares ExecutionOptions with nixPackages; subprocess validates nix-shell availability and conditionally spawns via nix-shell --run when packages present; daemon forwards job.nix_packages through all run types.
Agent documentation and config
AGENTS.md
Documents connector dependency handling, compilation timing, SDK externalization, and extends dynamic-import allow-list for CLI apply command.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as CLI apply
  participant DepMgr as ensure-deps-installed
  participant Compiler as connector-worker compile
  participant ApplyClient as ApplyClient
  participant Server as Server
  participant Daemon as Worker daemon
  participant Executor as SubprocessExecutor
  
  CLI->>DepMgr: ensure deps for sourcePath
  DepMgr->>DepMgr: locate lobu.toml, check stale
  DepMgr->>DepMgr: bun install --ignore-scripts
  CLI->>Compiler: compile .connector.ts file
  Compiler->>Compiler: externalize `@lobu/connector-sdk`
  Compiler-->>CLI: compiled sourceCode
  CLI->>ApplyClient: installConnector(sourceCode, compiled: true)
  ApplyClient->>Server: install_connector request
  Server->>Server: store sourceCode + compiled flag
  
  Daemon->>Server: pollWorkerJob
  Server->>Server: LEFT JOIN connector_definitions for runtime.nix
  Server-->>Daemon: PollResponse with nix_packages
  Daemon->>Executor: executeCompiledConnector(nixPackages)
  Executor->>Executor: validate nix-shell available
  Executor->>Executor: spawn('nix-shell', exec node runner)
  Executor->>Executor: child inherits nixPackages on PATH
  Executor-->>Daemon: ExecutorResult
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • lobu-ai/lobu#967: This PR implements the code-level foundation described in that issue—runtime.nix metadata, CLI dependency management and local compilation, SDK externalization, and nix-shell execution threading through the worker daemon and executor pipeline.

Possibly related PRs

  • lobu-ai/lobu#931: Both PRs modify the executor contract (executor/interface.ts, executor/runtime.ts, executor/subprocess.ts); the referenced PR refactored to the V1 ExecutorJob/hooks protocol, and this PR extends that same execution path to forward nixPackages into nix-shell wrapping.

Suggested labels

skip-size-check

Poem

🐰 Connectors now compile where developers declare,
With nix-shell wrapping system tools with care,
Dependencies bundled, the SDK stays remote,
Local sources thrive in the apply workflow's note,
A hutch of convenience for connector devs fair!

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title describes rebuilding pgvector-embedded artifacts, but the actual changeset includes extensive connector runtime/dependency handling features, SDK externalization, CLI compilation, and executor enhancements—none of which are reflected in the title. Revise the PR title to accurately reflect the primary changes: consider combining the connector dependency/runtime work with the pgvector rebuild, or split into separate PRs with appropriately scoped titles.
Description check ⚠️ Warning The PR description is largely incomplete. It only mentions the pgvector rebuild and omits the extensive connector runtime/dependency handling, compilation, and executor changes documented in the commit messages and file summaries. Expand the description to document the connector runtime/dependency feature, SDK externalization, CLI-side compilation, and executor nix-shell integration; include a test plan with relevant validation steps.
Docstring Coverage ⚠️ Warning Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/pgvector-embedded-v0.8.1-26182530484

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/connector-worker/src/executor/subprocess.ts (1)

201-224: 💤 Low value

Consider quoting execArgv elements for defense-in-depth.

The execArgv array contents are currently safe (controlled values like --max-old-space-size=512), but they're joined into the nix-shell --run command without quoting. If execArgv ever accepts external input, this could become a shell injection vector.

For now this is low risk since execArgv is constructed internally, but you could defensively quote all arguments:

🛡️ Optional defensive fix
-        const nodeCmd = ['exec', 'node', ...execArgv, shellQuote(childRunnerPath)].join(' ');
+        const nodeCmd = ['exec', 'node', ...execArgv.map(shellQuote), shellQuote(childRunnerPath)].join(' ');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/connector-worker/src/executor/subprocess.ts` around lines 201 - 224,
The nodeCmd string used for nix-shell --run interpolates execArgv unquoted,
which could be a shell-injection risk if execArgv ever contains external input;
update the nodeCmd construction in the spawn branch so each execArgv element is
passed through the existing shellQuote helper (like shellQuote(execArgv[i]))
before joining, ensuring execArgv, childRunnerPath and other parts are properly
quoted when building nodeCmd used in nixArgs (--run).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/cli/src/commands/_lib/ensure-deps-installed.ts`:
- Around line 35-42: The installIsStale function currently only compares
bun.lock vs node_modules; update it to also consider package.json modifications:
obtain the mtimeMs for package.json (join(root, "package.json")) and treat the
install as stale if package.json.mtimeMs > node_modules.mtimeMs (or if bun.lock
exists and bun.lock.mtimeMs > node_modules.mtimeMs); if package.json is missing
keep existing behavior, and preserve the try/catch around statSync calls for
node_modules, bun.lock, and package.json when determining staleness in
installIsStale.

In `@packages/cli/src/commands/init.ts`:
- Around line 720-726: The current broad catch around JSON.parse(await
readFile(pkgJsonPath, "utf-8")) masks parse, permission, and other I/O errors
and treats them as "missing file"; change the logic so you first attempt to read
the file and only treat ENOENT (file-not-found) as the condition to create the
fallback pkgJson, while rethrowing or surfaceing other errors (e.g., permission
errors or invalid JSON). Concretely: isolate the readFile call and catch only
errors whose code === "ENOENT" to set pkgJson = { ...fallback... }; run
JSON.parse in its own try and handle JSON parse errors separately (log and exit
or rethrow). Apply the same tightening of error checks to the similar catch
block around the scaffold/write flow referenced near the other catch (lines
~741-744) so you never overwrite an existing project on non-ENOENT errors.

In `@packages/server/src/worker-api.ts`:
- Around line 504-506: The LEFT JOIN to connector_definitions (alias cd) using
cd.key = r.connector_key and cd.organization_id = r.organization_id with
cd.status = 'active' can produce duplicate rows if multiple active rows exist;
change this join to select a single connector_definition per r by using a
LATERAL subquery (or an ordered subquery with ORDER BY ... LIMIT 1) that filters
status = 'active' and matches r.connector_key and r.organization_id (similar to
the strategy used in the claim CTE), ensuring only one cd row is returned per r
to avoid duplication.

---

Nitpick comments:
In `@packages/connector-worker/src/executor/subprocess.ts`:
- Around line 201-224: The nodeCmd string used for nix-shell --run interpolates
execArgv unquoted, which could be a shell-injection risk if execArgv ever
contains external input; update the nodeCmd construction in the spawn branch so
each execArgv element is passed through the existing shellQuote helper (like
shellQuote(execArgv[i])) before joining, ensuring execArgv, childRunnerPath and
other parts are properly quoted when building nodeCmd used in nixArgs (--run).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a01dae13-cc9c-4755-a986-a93349395ae2

📥 Commits

Reviewing files that changed from the base of the PR and between 7793c56 and 06e8fed.

⛔ Files ignored due to path filters (4)
  • packages/pgvector-embedded/prebuilt/darwin-arm64/vector.dylib is excluded by !**/*.dylib
  • packages/pgvector-embedded/prebuilt/darwin-x64/vector.dylib is excluded by !**/*.dylib
  • packages/pgvector-embedded/prebuilt/linux-arm64/vector.so is excluded by !**/*.so
  • packages/pgvector-embedded/prebuilt/linux-x64/vector.so is excluded by !**/*.so
📒 Files selected for processing (13)
  • AGENTS.md
  • packages/cli/src/commands/_lib/apply/apply-cmd.ts
  • packages/cli/src/commands/_lib/apply/client.ts
  • packages/cli/src/commands/_lib/ensure-deps-installed.ts
  • packages/cli/src/commands/init.ts
  • packages/connector-sdk/src/connector-types.ts
  • packages/connector-worker/src/compile/index.ts
  • packages/connector-worker/src/daemon/client.ts
  • packages/connector-worker/src/daemon/executor.ts
  • packages/connector-worker/src/executor/interface.ts
  • packages/connector-worker/src/executor/runtime.ts
  • packages/connector-worker/src/executor/subprocess.ts
  • packages/server/src/worker-api.ts

Comment on lines +35 to +42
function installIsStale(root: string): boolean {
const nodeModules = join(root, "node_modules");
if (!existsSync(nodeModules)) return true;
const lock = join(root, "bun.lock");
if (!existsSync(lock)) return false; // deps present, no lockfile to compare against
try {
return statSync(lock).mtimeMs > statSync(nodeModules).mtimeMs;
} catch {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Staleness check should include package.json changes

Line 35-42 only compares bun.lock vs node_modules. If package.json changed but the lockfile wasn’t updated yet, this returns non-stale and skips install, causing downstream module-resolution failures during compile.

Proposed fix
 function installIsStale(root: string): boolean {
   const nodeModules = join(root, "node_modules");
   if (!existsSync(nodeModules)) return true;
+  const packageJson = join(root, "package.json");
   const lock = join(root, "bun.lock");
-  if (!existsSync(lock)) return false; // deps present, no lockfile to compare against
   try {
-    return statSync(lock).mtimeMs > statSync(nodeModules).mtimeMs;
+    const nodeModulesMtime = statSync(nodeModules).mtimeMs;
+    const packageMtime = existsSync(packageJson)
+      ? statSync(packageJson).mtimeMs
+      : 0;
+    const lockMtime = existsSync(lock) ? statSync(lock).mtimeMs : 0;
+    return Math.max(packageMtime, lockMtime) > nodeModulesMtime;
   } catch {
     return false;
   }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function installIsStale(root: string): boolean {
const nodeModules = join(root, "node_modules");
if (!existsSync(nodeModules)) return true;
const lock = join(root, "bun.lock");
if (!existsSync(lock)) return false; // deps present, no lockfile to compare against
try {
return statSync(lock).mtimeMs > statSync(nodeModules).mtimeMs;
} catch {
function installIsStale(root: string): boolean {
const nodeModules = join(root, "node_modules");
if (!existsSync(nodeModules)) return true;
const packageJson = join(root, "package.json");
const lock = join(root, "bun.lock");
try {
const nodeModulesMtime = statSync(nodeModules).mtimeMs;
const packageMtime = existsSync(packageJson)
? statSync(packageJson).mtimeMs
: 0;
const lockMtime = existsSync(lock) ? statSync(lock).mtimeMs : 0;
return Math.max(packageMtime, lockMtime) > nodeModulesMtime;
} catch {
return false;
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/commands/_lib/ensure-deps-installed.ts` around lines 35 -
42, The installIsStale function currently only compares bun.lock vs
node_modules; update it to also consider package.json modifications: obtain the
mtimeMs for package.json (join(root, "package.json")) and treat the install as
stale if package.json.mtimeMs > node_modules.mtimeMs (or if bun.lock exists and
bun.lock.mtimeMs > node_modules.mtimeMs); if package.json is missing keep
existing behavior, and preserve the try/catch around statSync calls for
node_modules, bun.lock, and package.json when determining staleness in
installIsStale.

Comment on lines +720 to +726
try {
pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf-8")) as Record<
string,
unknown
>;
} catch {
pkgJson = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restrict fallback behavior to missing-file errors only

At Line 720 and Line 741, the broad catch treats parse/permission/path errors as “file missing,” then proceeds to write scaffolding files. In --here flows, this can overwrite existing project files unexpectedly.

Proposed fix
-    try {
-      pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf-8")) as Record<
-        string,
-        unknown
-      >;
-    } catch {
+    try {
+      const raw = await readFile(pkgJsonPath, "utf-8");
+      pkgJson = JSON.parse(raw) as Record<string, unknown>;
+    } catch (err) {
+      const code = (err as NodeJS.ErrnoException).code;
+      if (code !== "ENOENT") throw err;
       pkgJson = {
         name: projectName,
         version: "0.0.0",
         private: true,
         type: "module",
       };
     }
@@
-    try {
-      await readFile(tsconfigPath, "utf-8"); // exists — leave the user's config untouched
-    } catch {
+    try {
+      await readFile(tsconfigPath, "utf-8"); // exists — leave the user's config untouched
+    } catch (err) {
+      const code = (err as NodeJS.ErrnoException).code;
+      if (code !== "ENOENT") throw err;
       await writeFile(
         tsconfigPath,
         `${JSON.stringify(

Also applies to: 741-744

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/commands/init.ts` around lines 720 - 726, The current broad
catch around JSON.parse(await readFile(pkgJsonPath, "utf-8")) masks parse,
permission, and other I/O errors and treats them as "missing file"; change the
logic so you first attempt to read the file and only treat ENOENT
(file-not-found) as the condition to create the fallback pkgJson, while
rethrowing or surfaceing other errors (e.g., permission errors or invalid JSON).
Concretely: isolate the readFile call and catch only errors whose code ===
"ENOENT" to set pkgJson = { ...fallback... }; run JSON.parse in its own try and
handle JSON parse errors separately (log and exit or rethrow). Apply the same
tightening of error checks to the similar catch block around the scaffold/write
flow referenced near the other catch (lines ~741-744) so you never overwrite an
existing project on non-ENOENT errors.

Comment on lines +504 to +506
LEFT JOIN connector_definitions cd ON cd.key = r.connector_key
AND cd.organization_id = r.organization_id
AND cd.status = 'active'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Potential row duplication if multiple active connector_definitions exist.

The LEFT JOIN connector_definitions at lines 504-506 doesn't include LIMIT 1 or deduplication. If an organization has multiple connector_definitions rows for the same key with status = 'active', this join will produce duplicate result rows. Consider using a LATERAL subquery with LIMIT 1 (similar to the claim CTE at lines 373-380) or adding ORDER BY ... LIMIT 1:

-      LEFT JOIN connector_definitions cd ON cd.key = r.connector_key
-        AND cd.organization_id = r.organization_id
-        AND cd.status = 'active'
+      LEFT JOIN LATERAL (
+        SELECT runtime FROM connector_definitions
+        WHERE key = r.connector_key
+          AND organization_id = r.organization_id
+          AND status = 'active'
+        ORDER BY updated_at DESC, id DESC
+        LIMIT 1
+      ) cd ON true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
LEFT JOIN connector_definitions cd ON cd.key = r.connector_key
AND cd.organization_id = r.organization_id
AND cd.status = 'active'
LEFT JOIN LATERAL (
SELECT runtime FROM connector_definitions
WHERE key = r.connector_key
AND organization_id = r.organization_id
AND status = 'active'
ORDER BY updated_at DESC, id DESC
LIMIT 1
) cd ON true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/worker-api.ts` around lines 504 - 506, The LEFT JOIN to
connector_definitions (alias cd) using cd.key = r.connector_key and
cd.organization_id = r.organization_id with cd.status = 'active' can produce
duplicate rows if multiple active rows exist; change this join to select a
single connector_definition per r by using a LATERAL subquery (or an ordered
subquery with ORDER BY ... LIMIT 1) that filters status = 'active' and matches
r.connector_key and r.organization_id (similar to the strategy used in the claim
CTE), ensuring only one cd row is returned per r to avoid duplication.

@buremba
Copy link
Copy Markdown
Member

buremba commented May 20, 2026

Closing as duplicate. The build-pgvector-embedded workflow opened 6 PRs for the same v0.8.1 rebuild; the build is non-deterministic so these only churn binary artifacts with no functional change. Several also carry already-merged work (#973, #978) or the release-please 9.0.0 commit (#939). main's existing prebuilt artifacts are kept.

@buremba buremba closed this May 20, 2026
@buremba buremba deleted the chore/pgvector-embedded-v0.8.1-26182530484 branch May 20, 2026 19:38
buremba added a commit that referenced this pull request May 25, 2026
…1051)

The push trigger used a bare paths filter, which GitHub ignores for
freshly-created refs (it can't diff them). So every release-please tag
(lobu-vX.Y.Z) ran the rebuild and, because the binaries aren't
byte-reproducible, opened a no-op 'rebuild artifacts' PR each release
(#972, #974, #975, #977, #979, #980, #981, #996, #1002, #1005, #1025,
#1029).

Scope the push trigger to branches: [main] so tag refs no longer match,
and drop the workflow file from paths (only build.sh changes the
artifacts). workflow_dispatch still covers deliberate pgvector/PG bumps.
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