fix(cli): emit agent-tool diagnostic instead of plugins.allow suggestion#77220
fix(cli): emit agent-tool diagnostic instead of plugins.allow suggestion#77220hclsys wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. from source inspection. Current main reaches the misleading Next step before merge Security Review findings
Review detailsBest possible solution: Keep manifest-backed tool lookup, but make it skip inputs that are also known plugin ids or CLI roots, then add regression coverage for Do we have a high-confidence way to reproduce the issue? Yes, from source inspection. Current main reaches the misleading Is this the best way to solve the issue? No as currently implemented. Manifest Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ef0dbcf49d85. |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Pushed fixup for clawsweeper P3: corrected CHANGELOG reference |
When an unrecognized CLI subcommand matches a tool name in contracts.tools of an installed plugin, surface a targeted message explaining it is an agent tool (not a CLI subcommand) rather than incorrectly suggesting the user add it to plugins.allow. Adds resolveManifestToolOwner (manifest-command-aliases.runtime.ts) and wires resolveToolOwner option through resolveMissingPluginCommandMessage. Fixes openclaw#77214. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
d855d82 to
0c8451a
Compare
|
Pushed CHANGELOG entry (commit |
|
Closing — stale past the empirical 20h ceiling with no maintainer signal. Happy to revisit if the underlying issue stays relevant. |
Root cause
resolveMissingPluginCommandMessageinsrc/cli/run-main-policy.tsfalls straight through to theplugins.allowsuggestion branch when the user types an unrecognized subcommand. It has no awareness ofcontracts.tools— the tool names a plugin registers for agent model-use. Soopenclaw wecom_mcp(a tool name, not a CLI command) produces:That's wrong:
wecom_mcpis never a CLI subcommand, and adding it toplugins.allowdoes nothing useful.Fix
src/plugins/manifest-command-aliases.runtime.ts— addsresolveManifestToolOwner, which loads the manifest registry and searches each plugin'scontracts.toolsarray for a matching tool name.src/cli/run-main-policy.ts— addsresolveToolOwner?: (toolName: string) => string | undefinedto the options ofresolveMissingPluginCommandMessage; calls it just before theplugins.allowbranch. If it returns a plugin ID, emits a targeted diagnostic instead.src/cli/run-main.ts— wiresresolveToolOwner: (toolName) => resolveManifestToolOwner({ toolName, config })at the runtime call site alongside the existingresolveCommandAliasOwner.Example output after fix
Tests
Two new unit tests in
src/cli/run-main.test.ts:resolveToolOwneridentifies the tool ownerplugins.allowmessage whenresolveToolOwnerreturns undefinedAll 29 existing tests continue to pass.
Fixes #77214.