Просмотр исходного кода

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

kevin.yang 14 часов назад
Родитель
Сommit
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;
           }