Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

style(skill): 子命令分隔符判定补注释,用空格突出关键符号

ZHan99073daf0eb4df
diff --git a/jiuwenswarm/agents/harness/common/rails/skill_credential_injection_rail.py b/jiuwenswarm/agents/harness/common/rails/skill_credential_injection_rail.py
index d757d1707e..7c8d25dd48 100644
--- a/jiuwenswarm/agents/harness/common/rails/skill_credential_injection_rail.py
+++ b/jiuwenswarm/agents/harness/common/rails/skill_credential_injection_rail.py
@@ -110,12 +110,15 @@ def _split_subcommands(command: str) -> list[str]:
buf.append(ch)
i += 1
continue
+ # 二字符分隔符 && / || 必须先于单字符 ; | & 判定:
+ # 否则 || 会被当成单个 | 拆开(产生空子命令),&& 同理
sep_len = 0
if command[i : i + 2] in ("&&", "||"):
sep_len = 2
elif ch in (";", "|", "&"):
+ # 2>&1 等重定向的 & 不拆(前一个字符是 > )
if ch == "&" and i > 0 and command[i - 1] == ">":
- sep_len = 0 # 2>&1 重定向,不拆
+ sep_len = 0
else:
sep_len = 1
if sep_len: