fix: pass tool names to registerTool factory opts#51
Open
Grynn wants to merge 1 commit intoMartian-Engineering:mainfrom
Open
fix: pass tool names to registerTool factory opts#51Grynn wants to merge 1 commit intoMartian-Engineering:mainfrom
Grynn wants to merge 1 commit intoMartian-Engineering:mainfrom
Conversation
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 Martian-Engineering#32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When lossless-claw loads on OpenClaw, the plugin status shows
"status": "loaded"with no errors, but"toolNames": []— the four LCM tools (lcm_grep,lcm_describe,lcm_expand,lcm_expand_query) are never exposed to the agent.Root Cause
The tools are registered using factory functions without the
opts.namehint:When a factory function is passed without
opts.name/opts.names, OpenClaw cannot discover the tool names until the factory is invoked per-session, which prevents the tools from being injected into the agent's available tool list.Fix
Pass
{ name: "..." }as the second argument to eachregisterToolcall:Tool names match what each factory function returns (verified against
src/tools/*.ts).Fixes #32