Ver código fonte

Merge pull request #3087 from jinhan1414/feat/mention-updates

feat(mentions): Enhance slash command and mention processing
Evgeny Shurakov 2 meses atrás
pai
commit
2eabf6a34c

+ 5 - 0
.changeset/smooth-hands-fry.md

@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Unify slash command parsing and expand mention detection

+ 5 - 4
src/core/mentions/processKiloUserContentMentions.ts

@@ -38,9 +38,9 @@ export async function processKiloUserContentMentions({
 	// Track if we need to check kilorules file
 	let needsRulesFileCheck = false
 
-	/**
-	 * Process mentions in user content, specifically within task and feedback tags
-	 */
+	// kilocode_change
+	const mentionTagRegex = /<(?:task|feedback|answer|user_message)>/
+
 	const processUserContentMentions = async () => {
 		// Process userContent array, which contains various block types:
 		// TextBlockParam, ImageBlockParam, ToolUseBlockParam, and ToolResultBlockParam.
@@ -57,7 +57,8 @@ export async function processKiloUserContentMentions({
 
 		return await Promise.all(
 			userContent.map(async (block) => {
-				const shouldProcessMentions = (text: string) => text.includes("<task>") || text.includes("<feedback>")
+				// kilocode_change
+				const shouldProcessMentions = (text: string) => mentionTagRegex.test(text)
 
 				if (block.type === "text") {
 					if (shouldProcessMentions(block.text)) {