Skip to content

fix: copy plugin manifests into dist/extensions#81

Open
bobberb wants to merge 1 commit intoopenclaw:mainfrom
bobberb:fix/copy-plugin-manifests
Open

fix: copy plugin manifests into dist/extensions#81
bobberb wants to merge 1 commit intoopenclaw:mainfrom
bobberb:fix/copy-plugin-manifests

Conversation

@bobberb
Copy link
Copy Markdown

@bobberb bobberb commented Mar 17, 2026

Summary

  • The gateway discovers plugins by looking for openclaw.plugin.json manifests at dist/extensions/*/openclaw.plugin.json
  • The TypeScript build emits compiled .js files into dist/extensions/*/ but does not copy the openclaw.plugin.json manifests from the source extensions/ tree
  • After the existing extensions copy step in gateway-install.sh, iterate over extensions/*/openclaw.plugin.json and copy each manifest into its corresponding dist/extensions/*/ directory so the gateway can discover plugins at runtime

Relates to #6, #14.

Test plan

  • Build the Nix package and verify dist/extensions/*/openclaw.plugin.json files exist in the output
  • Start the gateway and confirm plugins are discovered and loaded

🤖 Generated with Claude Code

The TypeScript build emits compiled .js files into dist/extensions/*/
but does not copy the openclaw.plugin.json manifests. The gateway
discovers plugins by looking for manifests at
dist/extensions/*/openclaw.plugin.json, so they were never found.

After copying the source extensions/ tree, iterate over its plugin
manifests and place them into the corresponding dist/extensions/
directories so the gateway can load them at runtime.

Relates to openclaw#6, openclaw#14.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ivankovnatsky added a commit to ivankovnatsky/nix-config that referenced this pull request Mar 19, 2026
@Weirdei
Copy link
Copy Markdown

Weirdei commented Mar 20, 2026

Tested and confirmed this approach works. We independently arrived at the same fix via a NixOS overlay:

# overlays/openclaw-fix-manifests.nix
final: prev: {
  openclaw-gateway = final.runCommand "openclaw-gateway-fixed" {
    inherit (prev.openclaw-gateway) meta;
    nativeBuildInputs = [final.gnused];
  } ''
    cp -r ${prev.openclaw-gateway} $out
    chmod -R u+w $out
    for ext_dir in $out/lib/openclaw/extensions/*/; do
      ext_name=$(basename "$ext_dir")
      manifest="$ext_dir/openclaw.plugin.json"
      dist_dir="$out/lib/openclaw/dist/extensions/$ext_name"
      if [ -f "$manifest" ] && [ -d "$dist_dir" ]; then
        cp "$manifest" "$dist_dir/"
      fi
    done
    for wrapper in $out/bin/*; do
      if [ -f "$wrapper" ]; then
        sed -i "s|${prev.openclaw-gateway}|$out|g" "$wrapper"
      fi
    done
  '';
}

With this overlay applied, all 74 plugin manifests land in dist/extensions/*/, Telegram channel connects, and the gateway runs cleanly on NixOS. Would love to see this merged so we can drop the workaround.

@Weirdei
Copy link
Copy Markdown

Weirdei commented Mar 21, 2026

Two additional packaging issues found beyond the manifests fix in this PR:

1. Bundled skills/ directory not copied to package root

The gateway resolves bundled skills via findPackageRootSync → looks for skills/ next to package.json. The nix derivation copies dist/, docs/, extensions/, node_modules/, package.json to lib/openclaw/ but not skills/. The actual skills live deep in node_modules/.pnpm/openclaw@.../node_modules/openclaw/skills/ (53 skills).

Result: resolveBundledSkillsDir() returns undefined → "Bundled skills directory could not be resolved". None of the built-in skills (weather, nano-pdf, summarize, etc.) are available.

Gateway supports OPENCLAW_BUNDLED_SKILLS_DIR env override, but the proper fix is to copy/symlink skills/ into the package root alongside dist/.

2. Wrapper script hardcodes original store path

The nix wrapper at bin/openclaw does:

exec node /nix/store/<original-hash>-openclaw-gateway-unstable-.../lib/openclaw/dist/index.js

If you patch the package (e.g., to fix manifests), the wrapper still points to the unpatched original. Any overlay using runCommand to copy+fix the package must also rewrite wrapper scripts.

Our full overlay handling all three issues: #82 (comment)

@bobberb
Copy link
Copy Markdown
Author

bobberb commented Mar 23, 2026

@Weirdei good to close this one?

@Weirdei
Copy link
Copy Markdown

Weirdei commented Mar 24, 2026

This PR should be merged, not closed — it correctly fixes the manifests issue. The two additional packaging problems I mentioned (missing skills/ dir and wrapper path hardcoding) are tracked separately in #82.

Merging this lets us drop part of our overlay already.

ivankovnatsky added a commit to ivankovnatsky/nix-config that referenced this pull request Mar 29, 2026
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.

2 participants