Ver código fonte

[openclaw]不对用户输入的slash command搜索知识库

kevin.yang 12 horas atrás
pai
commit
91fb30776d
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      knowhub/skill/openclaw-plugin/index.ts

+ 2 - 2
knowhub/skill/openclaw-plugin/index.ts

@@ -514,8 +514,8 @@ const knowhubPlugin = {
       api.on("before_prompt_build", async (event, ctx) => {
         try {
           const stripped = stripLeadingInboundMetadata(event.prompt);
-          const userPrompt = normalizeStrippedInboundText(stripped);
-          if (!userPrompt || userPrompt.length < 5) {
+          const userPrompt = normalizeStrippedInboundText(stripped).trim();
+          if (!userPrompt || userPrompt.length < 5 || userPrompt.startsWith("/")) {
             return;
           }