fix: devops 处理器剥离中文前缀再执行
This commit is contained in:
parent
85cc42cec6
commit
528b5a7cb6
@ -877,6 +877,9 @@ if action == 'send_message':
|
|||||||
agent_reply = f"❌ 导入失败:{msg}"
|
agent_reply = f"❌ 导入失败:{msg}"
|
||||||
elif intent_type == 'devops':
|
elif intent_type == 'devops':
|
||||||
description = intent.get('description', '') or message_text
|
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'
|
workdir = ctx.get('workspace_dir', '') or '/d/pipeline/workspaces'
|
||||||
result = await shell_exec(description, workdir=workdir)
|
result = await shell_exec(description, workdir=workdir)
|
||||||
if result['rc'] == 0:
|
if result['rc'] == 0:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user