From 528b5a7cb655d26bdc2f2f59a11de6985f21bd80 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 5 Aug 2026 18:01:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20devops=20=E5=A4=84=E7=90=86=E5=99=A8?= =?UTF-8?q?=E5=89=A5=E7=A6=BB=E4=B8=AD=E6=96=87=E5=89=8D=E7=BC=80=E5=86=8D?= =?UTF-8?q?=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/cockpit_chat.dspy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wwwroot/api/cockpit_chat.dspy b/wwwroot/api/cockpit_chat.dspy index e0ba432..263b341 100644 --- a/wwwroot/api/cockpit_chat.dspy +++ b/wwwroot/api/cockpit_chat.dspy @@ -877,6 +877,9 @@ if action == 'send_message': agent_reply = f"❌ 导入失败:{msg}" elif intent_type == 'devops': description = intent.get('description', '') or message_text + # 去掉中文前缀("执行命令:"、"运行:"等) + import re + description = re.sub(r'^(执行命令[::]|运行[::]|git\s+)', '', description.strip()) workdir = ctx.get('workspace_dir', '') or '/d/pipeline/workspaces' result = await shell_exec(description, workdir=workdir) if result['rc'] == 0: