From 6308471b2a4ca448c09b2dc97053e23154c187ff Mon Sep 17 00:00:00 2001 From: alvis Date: Sun, 5 Jul 2026 09:49:46 +0000 Subject: [PATCH] fix(docker): ship packages/ai so gateway resolves @openclaw/ai at runtime The runtime stage copied node_modules (with the @openclaw/ai workspace symlink -> ../../packages/ai) but not packages/ai itself, leaving a dangling symlink. Gateway boot failed: 'Cannot find package @openclaw/ai'. Copy the built lib into the runtime image. Verified: gateway now boots, loads config, and stays listening with --allow-unconfigured. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2 --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 76cb7762..30318e8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -198,6 +198,10 @@ RUN chown node:node /app COPY --from=runtime-assets --chown=node:node /app/dist ./dist COPY --from=runtime-assets --chown=node:node /app/node_modules ./node_modules +# node_modules/@openclaw/ai is a workspace symlink -> ../../packages/ai; the +# built lib must ship so the gateway's `import "@openclaw/ai"` resolves at +# runtime (otherwise: "Cannot find package '@openclaw/ai'"). Adolf fork fix. +COPY --from=runtime-assets --chown=node:node /app/packages/ai ./packages/ai COPY --from=runtime-assets --chown=node:node /app/package.json . COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml . COPY --from=runtime-assets --chown=node:node /app/patches ./patches