Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
refactor: simplify ampersand segment check
chengyongruab6ceef1a1c1
diff --git a/nanobot/agent/tools/shell.py b/nanobot/agent/tools/shell.pyindex d37bb9498..565b38eb5 100644--- a/nanobot/agent/tools/shell.py+++ b/nanobot/agent/tools/shell.py@@ -879,11 +879,10 @@ class ExecTool(Tool):if paren_depth == 0:if command.startswith(("&&", "||"), i):operator_len = 2- elif ch == "&":- prev_ch = command[i - 1] if i > 0 else ""- next_ch = command[i + 1] if i + 1 < len(command) else ""- if prev_ch not in {"<", ">"} and next_ch != ">":- operator_len = 1+ elif ch == "&" and not (+ (i > 0 and command[i - 1] in "<>") or command.startswith("&>", i)+ ):+ operator_len = 1elif ch in {";", "|"}:operator_len = 1