Browse Source

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

kevin.yang 14 giờ trước cách đây
mục cha
commit
91fb30776d

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

@@ -514,8 +514,8 @@ const knowhubPlugin = {
       api.on("before_prompt_build", async (event, ctx) => {
       api.on("before_prompt_build", async (event, ctx) => {
         try {
         try {
           const stripped = stripLeadingInboundMetadata(event.prompt);
           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;
             return;
           }
           }