Преглед изворни кода

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

kevin.yang пре 1 месец
родитељ
комит
91fb30776d
1 измењених фајлова са 2 додато и 2 уклоњено
  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;
           }