From b79cc1eb847ee34e5eb20c09e2bf470eb34f8195 Mon Sep 17 00:00:00 2001 From: zhi Date: Tue, 3 Mar 2026 18:16:47 +0000 Subject: [PATCH] fix: use api.resolvePath for plugin directory - Replace import.meta.url with api.resolvePath('.') for reliable path resolution - Fixes no-reply API not starting due to incorrect pluginDir calculation --- plugin/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/index.ts b/plugin/index.ts index eb2748e..350fe85 100644 --- a/plugin/index.ts +++ b/plugin/index.ts @@ -508,7 +508,8 @@ export default { ensurePolicyStateLoaded(api, liveAtRegister); // Resolve plugin directory for locating sibling modules (no-reply-api/) - const pluginDir = path.dirname(new URL(import.meta.url).pathname); + // Use api.resolvePath to get the actual plugin directory in OpenClaw environment + const pluginDir = api.resolvePath("."); // Gateway lifecycle: start/stop no-reply API and moderator bot with the gateway api.on("gateway_start", () => {