From fa3262f0ae1492353192838795cb8f792ae1553b Mon Sep 17 00:00:00 2001 From: Vishal Doshi Date: Wed, 11 Mar 2026 22:12:04 +0000 Subject: [PATCH 1/2] fix: pass tool names to registerTool factory opts When registering tools via factory functions, OpenClaw needs the tool name hint in the opts parameter to discover tools before the factory is invoked per-session. Without this, the plugin loads successfully but toolNames remains empty ([]). Fixes #32 --- index.ts | 58 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/index.ts b/index.ts index c878a1e09..e46568453 100644 --- a/index.ts +++ b/index.ts @@ -1286,34 +1286,42 @@ const lcmPlugin = { const lcm = new LcmContextEngine(deps); api.registerContextEngine("lossless-claw", () => lcm); - api.registerTool((ctx) => - createLcmGrepTool({ - deps, - lcm, - sessionKey: ctx.sessionKey, - }), + api.registerTool( + (ctx) => + createLcmGrepTool({ + deps, + lcm, + sessionKey: ctx.sessionKey, + }), + { name: "lcm_grep" }, ); - api.registerTool((ctx) => - createLcmDescribeTool({ - deps, - lcm, - sessionKey: ctx.sessionKey, - }), + api.registerTool( + (ctx) => + createLcmDescribeTool({ + deps, + lcm, + sessionKey: ctx.sessionKey, + }), + { name: "lcm_describe" }, ); - api.registerTool((ctx) => - createLcmExpandTool({ - deps, - lcm, - sessionKey: ctx.sessionKey, - }), + api.registerTool( + (ctx) => + createLcmExpandTool({ + deps, + lcm, + sessionKey: ctx.sessionKey, + }), + { name: "lcm_expand" }, ); - api.registerTool((ctx) => - createLcmExpandQueryTool({ - deps, - lcm, - sessionKey: ctx.sessionKey, - requesterSessionKey: ctx.sessionKey, - }), + api.registerTool( + (ctx) => + createLcmExpandQueryTool({ + deps, + lcm, + sessionKey: ctx.sessionKey, + requesterSessionKey: ctx.sessionKey, + }), + { name: "lcm_expand_query" }, ); api.logger.info( From d8b484fff5dd2de7e8890dde129fca252ae8406c Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Mon, 16 Mar 2026 06:21:29 -0700 Subject: [PATCH 2/2] chore: add changeset for tool registration metadata --- .changeset/calm-seals-kiss.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/calm-seals-kiss.md diff --git a/.changeset/calm-seals-kiss.md b/.changeset/calm-seals-kiss.md new file mode 100644 index 000000000..65a9b5534 --- /dev/null +++ b/.changeset/calm-seals-kiss.md @@ -0,0 +1,7 @@ +--- +"@martian-engineering/lossless-claw": patch +--- + +Declare explicit OpenClaw tool names for the LCM factory-registered tools so +plugin metadata and tool listings stay populated in hosts that require +`registerTool(..., { name })` hints for factory registrations.