#7090: fix: plugin install uses manifest ID for folder name (#2796)
Cluster:
Plugin Management Enhancements
**AI Assisted**
**Tested**
## Summary
- Plugin installation now prefers the `id` from `openclaw.plugin.json` over the npm package name for the installation folder
- Falls back to package name if no manifest or ID is found (backward compatible)
## Problem
When installing a plugin like `openclaw-penfield` (npm package name), it would install to `/extensions/openclaw-penfield/` even if he manifest specified `id: "penfield"`.
## Solution
Read `openclaw.plugin.json` during install and use the manifest ID if available.
## Tests
- [x] Tested with openclaw-penfield plugin (manifest ID differs from package name)
- [x] Verified fallback works when no manifest exists
- [ ] Existing unit tests pass
Fixes #2796
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates plugin installation to prefer the `id` from `openclaw.plugin.json` when choosing the extensions folder name, falling back to the npm package name when no valid manifest/id is available. The change is localized to `src/plugins/install.ts` and reuses the existing `loadPluginManifest()` helper used elsewhere in the plugins subsystem, keeping the rest of the install flow (copy, dependency install, backups on update) unchanged.
<h3>Confidence Score: 4/5</h3>
- This PR is generally safe to merge; it’s a small behavioral change in plugin directory naming with limited surface area.
- The change is simple and leverages existing manifest parsing, but it introduces a new source of truth for `pluginId` that may contain unexpected characters or formatting differences compared to npm-derived IDs, which can affect install paths and `expectedPluginId` checks.
- src/plugins/install.ts
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
83.8%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
82.2%
#4263: fix(plugins): default configSchema when missing from manifest
by SoulSniper-V2 · 2026-01-30
80.0%
#8073: fix(plugins): add --ignore-scripts to npm install
by yubrew · 2026-02-03
79.9%
#8020: fix(build): use entry alias to output plugin-sdk in subdirectory
by coletebou · 2026-02-03
78.7%
#4881: docs(plugin): clarify memory-lancedb is bundled (no npm install nee...
by AverageSuami · 2026-01-30
78.6%
#12849: fix(plugins): fallback bundled channel specs when npm install retur...
by vincentkoc · 2026-02-09
78.6%
#20499: test(plugins): add bundled+config duplicate discovery regression
by dcol91863 · 2026-02-19
77.0%
#23540: fix(compat): add legacy manifest keys for clawdbot and moltbot plugins
by 402goose · 2026-02-22
76.8%
#21871: fix(plugins): suppress false duplicate warning when user-installed ...
by hydro13 · 2026-02-20
76.6%