vasanthfeb13 commited on
Commit
a6867e2
·
1 Parent(s): 6eb02f0

Fix: Use shlex.split for command parsing

Browse files
Files changed (1) hide show
  1. src/nacc_orchestrator/server.py +2 -1
src/nacc_orchestrator/server.py CHANGED
@@ -514,6 +514,7 @@ connect to 473293 at 192.168.1.50 and name it as vasanth-laptop
514
  # Execute any shell command - AI-powered with fallback
515
  if tool_name == "execute_command" or query_lower.startswith(("execute ", "run ", "exec ")):
516
  import re
 
517
  # Extract command after keyword
518
  match = re.search(r'(?:execute|run|exec)(?:\s+command)?\s+(.+)', payload.query, re.IGNORECASE)
519
  if match:
@@ -526,7 +527,7 @@ connect to 473293 at 192.168.1.50 and name it as vasanth-laptop
526
  exec_result = service.execute_command_on_node(
527
  node_id=target_node,
528
  description=f"Execute: {command_str}",
529
- command=command_str.split(),
530
  timeout=payload.timeout
531
  )
532
 
 
514
  # Execute any shell command - AI-powered with fallback
515
  if tool_name == "execute_command" or query_lower.startswith(("execute ", "run ", "exec ")):
516
  import re
517
+ import shlex
518
  # Extract command after keyword
519
  match = re.search(r'(?:execute|run|exec)(?:\s+command)?\s+(.+)', payload.query, re.IGNORECASE)
520
  if match:
 
527
  exec_result = service.execute_command_on_node(
528
  node_id=target_node,
529
  description=f"Execute: {command_str}",
530
+ command=shlex.split(command_str),
531
  timeout=payload.timeout
532
  )
533