mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 14:38:38 +00:00
fix(config): soften antigravity removal fallout (#25538)
Land #25538 by @chilu18 to keep legacy google-antigravity-auth config entries non-fatal after removal (see #25862). Co-authored-by: chilu18 <chilu.machona@icloud.com>
This commit is contained in:
@@ -22,6 +22,8 @@ import { findLegacyConfigIssues } from "./legacy.js";
|
||||
import type { OpenClawConfig, ConfigValidationIssue } from "./types.js";
|
||||
import { OpenClawSchema } from "./zod-schema.js";
|
||||
|
||||
const LEGACY_REMOVED_PLUGIN_IDS = new Set(["google-antigravity-auth"]);
|
||||
|
||||
function isWorkspaceAvatarPath(value: string, workspaceDir: string): boolean {
|
||||
const workspaceRoot = path.resolve(workspaceDir);
|
||||
const resolved = path.resolve(workspaceRoot, value);
|
||||
@@ -313,6 +315,19 @@ function validateConfigObjectWithPluginsBase(
|
||||
}
|
||||
|
||||
const { registry, knownIds, normalizedPlugins } = ensureRegistry();
|
||||
const pushMissingPluginIssue = (path: string, pluginId: string) => {
|
||||
if (LEGACY_REMOVED_PLUGIN_IDS.has(pluginId)) {
|
||||
warnings.push({
|
||||
path,
|
||||
message: `plugin removed: ${pluginId} (stale config entry ignored; remove it from plugins config)`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
issues.push({
|
||||
path,
|
||||
message: `plugin not found: ${pluginId}`,
|
||||
});
|
||||
};
|
||||
|
||||
const pluginsConfig = config.plugins;
|
||||
|
||||
@@ -320,10 +335,7 @@ function validateConfigObjectWithPluginsBase(
|
||||
if (entries && isRecord(entries)) {
|
||||
for (const pluginId of Object.keys(entries)) {
|
||||
if (!knownIds.has(pluginId)) {
|
||||
issues.push({
|
||||
path: `plugins.entries.${pluginId}`,
|
||||
message: `plugin not found: ${pluginId}`,
|
||||
});
|
||||
pushMissingPluginIssue(`plugins.entries.${pluginId}`, pluginId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,10 +346,7 @@ function validateConfigObjectWithPluginsBase(
|
||||
continue;
|
||||
}
|
||||
if (!knownIds.has(pluginId)) {
|
||||
issues.push({
|
||||
path: "plugins.allow",
|
||||
message: `plugin not found: ${pluginId}`,
|
||||
});
|
||||
pushMissingPluginIssue("plugins.allow", pluginId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,19 +356,13 @@ function validateConfigObjectWithPluginsBase(
|
||||
continue;
|
||||
}
|
||||
if (!knownIds.has(pluginId)) {
|
||||
issues.push({
|
||||
path: "plugins.deny",
|
||||
message: `plugin not found: ${pluginId}`,
|
||||
});
|
||||
pushMissingPluginIssue("plugins.deny", pluginId);
|
||||
}
|
||||
}
|
||||
|
||||
const memorySlot = normalizedPlugins.slots.memory;
|
||||
if (typeof memorySlot === "string" && memorySlot.trim() && !knownIds.has(memorySlot)) {
|
||||
issues.push({
|
||||
path: "plugins.slots.memory",
|
||||
message: `plugin not found: ${memorySlot}`,
|
||||
});
|
||||
pushMissingPluginIssue("plugins.slots.memory", memorySlot);
|
||||
}
|
||||
|
||||
let selectedMemoryPluginId: string | null = null;
|
||||
|
||||
Reference in New Issue
Block a user