fix: strip -plugin suffix in deriveIdHint to match manifest ids (#85170)

The deriveIdHint function already strips -provider from unscoped
package names (@openclaw/anthropic-provider -> anthropic) but does
not strip -plugin (@openclaw/xai-plugin -> xai-plugin instead of
xai). This causes ~30 spurious 'plugin id mismatch' warnings on
gateway startup for built-in plugins whose package names end in
-plugin.

Closes #85048
This commit is contained in:
Julyan
2026-05-22 16:58:56 +08:00
committed by GitHub
parent 1b0a5d1627
commit 6f933656e5

View File

@@ -550,7 +550,9 @@ function deriveIdHint(params: {
const normalizedPackageId =
unscoped.endsWith("-provider") && unscoped.length > "-provider".length
? unscoped.slice(0, -"-provider".length)
: unscoped;
: unscoped.endsWith("-plugin") && unscoped.length > "-plugin".length
? unscoped.slice(0, -"-plugin".length)
: unscoped;
if (!params.hasMultipleExtensions) {
return normalizedPackageId;