mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 01:30:21 +00:00
fix: land plugin discovery missing-entry handling (#52491) (thanks @hclsys)
This commit is contained in:
@@ -35,6 +35,10 @@ function createEmptyPluginRegistry(): PluginRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
function createPluginRegistryStub(): PluginRegistry {
|
||||
return createEmptyPluginRegistry();
|
||||
}
|
||||
|
||||
const sessionBindingState = vi.hoisted(() => {
|
||||
const records = new Map<string, SessionBindingRecord>();
|
||||
let nextId = 1;
|
||||
|
||||
@@ -396,6 +396,23 @@ describe("discoverOpenClawPlugins", () => {
|
||||
expectEscapesPackageDiagnostic(result.diagnostics);
|
||||
});
|
||||
|
||||
it("skips missing package extension entries without escape diagnostics", async () => {
|
||||
const stateDir = makeTempDir();
|
||||
const globalExt = path.join(stateDir, "extensions", "missing-entry-pack");
|
||||
mkdirSafe(globalExt);
|
||||
|
||||
writePluginPackageManifest({
|
||||
packageDir: globalExt,
|
||||
packageName: "@openclaw/missing-entry-pack",
|
||||
extensions: ["./missing.ts"],
|
||||
});
|
||||
|
||||
const result = await discoverWithStateDir(stateDir, {});
|
||||
|
||||
expect(result.candidates).toHaveLength(0);
|
||||
expect(result.diagnostics).toEqual([]);
|
||||
});
|
||||
|
||||
it("rejects package extension entries that escape via symlink", async () => {
|
||||
const stateDir = makeTempDir();
|
||||
const globalExt = path.join(stateDir, "extensions", "pack");
|
||||
|
||||
Reference in New Issue
Block a user