Skip to content

Commit b520e40

Browse files
committed
fix(plugins): merge external catalog channel hints
1 parent 3928973 commit b520e40

3 files changed

Lines changed: 74 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Docs: https://docs.openclaw.ai
3232

3333
### Fixes
3434

35+
- Plugins/catalog: merge official external catalog descriptors into partial package channel config metadata, so lagging WeCom/Yuanbao manifests keep their own schema while still exposing host-supplied labels and setup text. Thanks @vincentkoc.
3536
- Plugins/catalog: supplement lagging official external WeCom and Yuanbao npm manifests with channel config descriptors and declared tool contracts from the OpenClaw catalog, so trusted package sweeps no longer fail because external package metadata trails the host contract. Thanks @vincentkoc.
3637
- Plugins/install: let trusted official `@openclaw/*` catalog installs recover when npm `latest` points at a prerelease by falling back to the newest stable version, or by allowing prerelease-only launch packages with a warning instead of making beta/development plugin sweeps fail at install time. Thanks @vincentkoc.
3738
- Google Meet: grant Chrome media permissions against the actual Meet tab, start the local realtime audio bridge only after Meet joins, expose realtime transcripts in status/logs, and force explicit audio responses with current OpenAI realtime output-audio events so BlackHole capture does not keep the OpenClaw participant muted or silent.

‎src/plugins/manifest-registry.test.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,48 @@ describe("loadPluginManifestRegistry", () => {
11331133
).toBe(false);
11341134
});
11351135

1136+
it("fills missing official external catalog descriptors for partial npm channel configs", () => {
1137+
const dir = makeTempDir();
1138+
writeManifest(dir, {
1139+
id: "wecom-openclaw-plugin",
1140+
channels: ["wecom"],
1141+
configSchema: { type: "object" },
1142+
channelConfigs: {
1143+
wecom: {
1144+
schema: {
1145+
type: "object",
1146+
additionalProperties: false,
1147+
properties: {
1148+
corpId: { type: "string" },
1149+
},
1150+
},
1151+
},
1152+
},
1153+
});
1154+
1155+
const registry = loadRegistry([
1156+
createPluginCandidate({
1157+
idHint: "wecom-openclaw-plugin",
1158+
rootDir: dir,
1159+
origin: "global",
1160+
packageName: "@wecom/wecom-openclaw-plugin",
1161+
}),
1162+
]);
1163+
1164+
expect(registry.plugins[0]?.channelConfigs?.wecom).toEqual(
1165+
expect.objectContaining({
1166+
label: "WeCom",
1167+
description: "Enterprise WeChat conversation channel.",
1168+
schema: expect.objectContaining({
1169+
additionalProperties: false,
1170+
properties: {
1171+
corpId: { type: "string" },
1172+
},
1173+
}),
1174+
}),
1175+
);
1176+
});
1177+
11361178
it("drops prototype-polluting channel config keys from plugin manifests", () => {
11371179
const dir = makeTempDir();
11381180
writeTextFile(

‎src/plugins/manifest-registry.ts‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,37 @@ function mergeCatalogChannelConfigs(params: {
322322
}
323323
for (const [key, value] of Object.entries(params.manifestChannelConfigs ?? {})) {
324324
if (!isBlockedObjectKey(key)) {
325-
merged[key] = value;
325+
const catalogValue = merged[key];
326+
merged[key] = catalogValue
327+
? {
328+
...catalogValue,
329+
...value,
330+
schema: value.schema ?? catalogValue.schema,
331+
...(catalogValue.uiHints || value.uiHints
332+
? {
333+
uiHints: {
334+
...catalogValue.uiHints,
335+
...value.uiHints,
336+
},
337+
}
338+
: {}),
339+
...((value.runtime ?? catalogValue.runtime)
340+
? { runtime: value.runtime ?? catalogValue.runtime }
341+
: {}),
342+
...((value.label ?? catalogValue.label)
343+
? { label: value.label ?? catalogValue.label }
344+
: {}),
345+
...((value.description ?? catalogValue.description)
346+
? { description: value.description ?? catalogValue.description }
347+
: {}),
348+
...((value.preferOver ?? catalogValue.preferOver)
349+
? { preferOver: value.preferOver ?? catalogValue.preferOver }
350+
: {}),
351+
...((value.commands ?? catalogValue.commands)
352+
? { commands: value.commands ?? catalogValue.commands }
353+
: {}),
354+
}
355+
: value;
326356
}
327357
}
328358
return Object.keys(merged).length > 0 ? merged : undefined;

0 commit comments

Comments
 (0)