mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 07:40:42 +00:00
Gateway: suppress tools.catalog plugin conflict diagnostics
This commit is contained in:
@@ -46,6 +46,7 @@ export function resolvePluginTools(params: {
|
||||
context: OpenClawPluginToolContext;
|
||||
existingToolNames?: Set<string>;
|
||||
toolAllowlist?: string[];
|
||||
suppressNameConflicts?: boolean;
|
||||
}): AnyAgentTool[] {
|
||||
// Fast path: when plugins are effectively disabled, avoid discovery/jiti entirely.
|
||||
// This matters a lot for unit tests and for tool construction hot paths.
|
||||
@@ -74,13 +75,15 @@ export function resolvePluginTools(params: {
|
||||
const pluginIdKey = normalizeToolName(entry.pluginId);
|
||||
if (existingNormalized.has(pluginIdKey)) {
|
||||
const message = `plugin id conflicts with core tool name (${entry.pluginId})`;
|
||||
log.error(message);
|
||||
registry.diagnostics.push({
|
||||
level: "error",
|
||||
pluginId: entry.pluginId,
|
||||
source: entry.source,
|
||||
message,
|
||||
});
|
||||
if (!params.suppressNameConflicts) {
|
||||
log.error(message);
|
||||
registry.diagnostics.push({
|
||||
level: "error",
|
||||
pluginId: entry.pluginId,
|
||||
source: entry.source,
|
||||
message,
|
||||
});
|
||||
}
|
||||
blockedPlugins.add(entry.pluginId);
|
||||
continue;
|
||||
}
|
||||
@@ -111,13 +114,15 @@ export function resolvePluginTools(params: {
|
||||
for (const tool of list) {
|
||||
if (nameSet.has(tool.name) || existing.has(tool.name)) {
|
||||
const message = `plugin tool name conflict (${entry.pluginId}): ${tool.name}`;
|
||||
log.error(message);
|
||||
registry.diagnostics.push({
|
||||
level: "error",
|
||||
pluginId: entry.pluginId,
|
||||
source: entry.source,
|
||||
message,
|
||||
});
|
||||
if (!params.suppressNameConflicts) {
|
||||
log.error(message);
|
||||
registry.diagnostics.push({
|
||||
level: "error",
|
||||
pluginId: entry.pluginId,
|
||||
source: entry.source,
|
||||
message,
|
||||
});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
nameSet.add(tool.name);
|
||||
|
||||
Reference in New Issue
Block a user