From f68a6f7d1b3f0a2ef3c3601243f6c7954bd213ae Mon Sep 17 00:00:00 2001 From: BoGuan <786506@gmail.com> Date: Mon, 2 Feb 2026 15:18:25 +0800 Subject: [PATCH] fix: remove redundant removeCodeBlocks call Remove duplicate removeCodeBlocks() call in keyword-detector/index.ts. The detectKeywordsWithType() function already calls removeCodeBlocks() internally, so calling it before passing the text was redundant and caused unnecessary double processing. --- src/hooks/keyword-detector/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/keyword-detector/index.ts b/src/hooks/keyword-detector/index.ts index c19540fe5..cad5aef05 100644 --- a/src/hooks/keyword-detector/index.ts +++ b/src/hooks/keyword-detector/index.ts @@ -36,7 +36,7 @@ export function createKeywordDetectorHook(ctx: PluginInput, collector?: ContextC // Remove system-reminder content to prevent automated system messages from triggering mode keywords const cleanText = removeSystemReminders(promptText) const modelID = input.model?.modelID - let detectedKeywords = detectKeywordsWithType(removeCodeBlocks(cleanText), currentAgent, modelID) + let detectedKeywords = detectKeywordsWithType(cleanText, currentAgent, modelID) if (isPlannerAgent(currentAgent)) { detectedKeywords = detectedKeywords.filter((k) => k.type !== "ultrawork")