fix: getuid not found in windows

This commit is contained in:
zhayujie
2026-02-07 11:17:58 +08:00
parent 051ffd78a3
commit 5264f7ce18
2 changed files with 7 additions and 3 deletions

View File

@@ -99,7 +99,11 @@ IMPORTANT SAFETY GUIDELINES:
logger.debug(f"[Bash] OPENAI_API_KEY in env: {'OPENAI_API_KEY' in env}")
logger.debug(f"[Bash] SHELL: {env.get('SHELL', 'not set')}")
logger.debug(f"[Bash] Python executable: {sys.executable}")
logger.debug(f"[Bash] Process UID: {os.getuid()}")
# getuid() only exists on Unix-like systems
if hasattr(os, 'getuid'):
logger.debug(f"[Bash] Process UID: {os.getuid()}")
else:
logger.debug(f"[Bash] Process User: {os.environ.get('USERNAME', os.environ.get('USER', 'unknown'))}")
# Execute command with inherited environment variables
result = subprocess.run(