Skip to content

Commit d749d59

Browse files
authored
Merge pull request #5171 from jxxghp/cursor/check-for-ai-prefix-before-processing-message-composer-1-29f2
2 parents 9b5f863 + 80396b4 commit d749d59

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/chain/message.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,10 @@ def _handle_ai_message(self, text: str, channel: MessageChannel, source: str,
943943
return
944944

945945
# 提取用户消息
946-
user_message = text[3:].strip() # 移除 "/ai" 前缀
946+
if text.lower().startswith("/ai"):
947+
user_message = text[3:].strip() # 移除 "/ai" 前缀(大小写不敏感)
948+
else:
949+
user_message = text.strip() # 按原消息处理
947950
if not user_message:
948951
self.post_message(Notification(
949952
channel=channel,

0 commit comments

Comments
 (0)