mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:10:45 +00:00
fix(plugins): deprecate registry disable break glass
This commit is contained in:
@@ -210,6 +210,19 @@ export const PLUGIN_COMPAT_RECORDS = [
|
||||
diagnostics: ["channel config metadata fallback"],
|
||||
tests: ["src/plugins/contracts/config-footprint-guardrails.test.ts"],
|
||||
},
|
||||
{
|
||||
code: "disable-persisted-plugin-registry-env",
|
||||
status: "deprecated",
|
||||
owner: "config",
|
||||
introduced: "2026-04-25",
|
||||
deprecated: "2026-04-25",
|
||||
warningStarts: "2026-04-25",
|
||||
replacement: "`openclaw plugins registry --refresh` and `openclaw doctor --fix`",
|
||||
docsPath: "/cli/plugins#registry",
|
||||
surfaces: ["OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY", "plugin registry reads"],
|
||||
diagnostics: ["persisted-registry-disabled"],
|
||||
tests: ["src/plugins/plugin-registry.test.ts"],
|
||||
},
|
||||
] as const satisfies readonly PluginCompatRecord[];
|
||||
|
||||
export type PluginCompatCode = (typeof PLUGIN_COMPAT_RECORDS)[number]["code"];
|
||||
|
||||
@@ -290,7 +290,10 @@ describe("plugin registry facade", () => {
|
||||
|
||||
expect(result.source).toBe("derived");
|
||||
expect(result.diagnostics).toEqual([
|
||||
expect.objectContaining({ code: "persisted-registry-disabled" }),
|
||||
expect.objectContaining({
|
||||
code: "persisted-registry-disabled",
|
||||
message: expect.stringContaining("deprecated break-glass compatibility switch"),
|
||||
}),
|
||||
]);
|
||||
expect(listPluginRecords({ index: result.snapshot }).map((plugin) => plugin.pluginId)).toEqual([
|
||||
"demo",
|
||||
|
||||
@@ -45,6 +45,10 @@ export type PluginRegistrySnapshotResult = {
|
||||
|
||||
export const DISABLE_PERSISTED_PLUGIN_REGISTRY_ENV = "OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY";
|
||||
|
||||
function formatDeprecatedPersistedRegistryDisableWarning(): string {
|
||||
return `${DISABLE_PERSISTED_PLUGIN_REGISTRY_ENV} is a deprecated break-glass compatibility switch; use \`openclaw plugins registry --refresh\` or \`openclaw doctor --fix\` to repair registry state.`;
|
||||
}
|
||||
|
||||
export type LoadPluginRegistryParams = LoadInstalledPluginIndexParams &
|
||||
InstalledPluginIndexStoreOptions & {
|
||||
index?: PluginRegistrySnapshot;
|
||||
@@ -175,7 +179,7 @@ export function loadPluginRegistrySnapshotWithMetadata(
|
||||
level: "warn",
|
||||
code: "persisted-registry-disabled",
|
||||
message: disabledByEnv
|
||||
? `${DISABLE_PERSISTED_PLUGIN_REGISTRY_ENV} is set; using legacy derived plugin index.`
|
||||
? `${formatDeprecatedPersistedRegistryDisableWarning()} Using legacy derived plugin index.`
|
||||
: "Persisted plugin registry reads are disabled by the caller; using derived plugin index.",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user