From 7622f7b3795fbce7ce52e5ca491495d17f280cb9 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 14 Nov 2026 10:58:29 -0600 Subject: [PATCH] fix(server): load only the Linux process birth probe --- .../scripts/verify-runner-vendor-dependencies.mjs | 2 +- server/src/services/hot-restart.ts | 4 ++-- .../paperclip-runner/live/linux-process-start.ts | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 server/src/vendor/paperclip-runner/live/linux-process-start.ts diff --git a/server/scripts/verify-runner-vendor-dependencies.mjs b/server/scripts/verify-runner-vendor-dependencies.mjs index 78d855d021b..ed9ee949c21 100644 --- a/server/scripts/verify-runner-vendor-dependencies.mjs +++ b/server/scripts/verify-runner-vendor-dependencies.mjs @@ -44,7 +44,7 @@ const runnerDist = resolve(runnerRoot, "dist"); // The only entry points server/src actually imports from the vendored // runner, including the installed-runtime readiness probe surface. -const ENTRY_POINT_NAMES = ["index.js", "testing.js", "live/index.js"]; +const ENTRY_POINT_NAMES = ["index.js", "testing.js", "live/index.js", "live/linux-process-start.js"]; const NODE_BUILTINS = new Set([ ...builtinModules, diff --git a/server/src/services/hot-restart.ts b/server/src/services/hot-restart.ts index f19a8232043..df351f71e7f 100644 --- a/server/src/services/hot-restart.ts +++ b/server/src/services/hot-restart.ts @@ -1,7 +1,7 @@ import { execFile } from "node:child_process"; import fs from "node:fs/promises"; import path from "node:path"; -import type { LinuxProcessStartOptions } from "../vendor/paperclip-runner/index.js"; +import type { LinuxProcessStartOptions } from "../vendor/paperclip-runner/live/linux-process-start.js"; import { resolvePaperclipHomeDir, resolvePaperclipInstanceId, @@ -186,7 +186,7 @@ export async function readProcessStartedAt( const runCommand = options.runCommand ?? runProcessCommand; if (platform === "linux") { - const { readLinuxProcessStartedAt } = await import("../vendor/paperclip-runner/index.js"); + const { readLinuxProcessStartedAt } = await import("../vendor/paperclip-runner/live/linux-process-start.js"); return readLinuxProcessStartedAt(pid, options.linuxProcessStart); } diff --git a/server/src/vendor/paperclip-runner/live/linux-process-start.ts b/server/src/vendor/paperclip-runner/live/linux-process-start.ts new file mode 100644 index 00000000000..8f843ac1fff --- /dev/null +++ b/server/src/vendor/paperclip-runner/live/linux-process-start.ts @@ -0,0 +1,15 @@ +import type { LinuxProcessStartOptions } from "@paperclipai/paperclip-runner"; + +export type { LinuxProcessStartOptions }; + +type LinuxProcessStartModule = Pick< + typeof import("@paperclipai/paperclip-runner"), + "readLinuxProcessStartedAt" +>; +const sourceUrl = new URL( + "../../../../../packages/paperclip-runner/src/live/linux-process-start.ts", + import.meta.url, +); +const linuxProcessStart = (await import(sourceUrl.href)) as LinuxProcessStartModule; + +export const readLinuxProcessStartedAt = linuxProcessStart.readLinuxProcessStartedAt;