fix(mma_exec): remove hardcoded C:\projects\misc\setup_*.ps1 paths — rely on PATH

This commit is contained in:
2026-03-02 16:42:11 -05:00
parent 3322b630c2
commit b30f040c7b
3 changed files with 26 additions and 9 deletions

View File

@@ -194,10 +194,7 @@ def execute_agent(role: str, prompt: str, docs: list[str], debug: bool = False,
command_text += f"\n\nTASK: {prompt}\n\n"
# Use subprocess with input to pipe the prompt via stdin, avoiding WinError 206.
# We use -p 'mma_task' to ensure non-interactive (headless) mode and valid parsing.
ps_command = (
f"if (Test-Path 'C:\\projects\\misc\\setup_gemini.ps1') {{ . 'C:\\projects\\misc\\setup_gemini.ps1' }}; "
f"gemini -p '{role}' --output-format json --model {model}"
)
ps_command = f"gemini -p '{role}' --output-format json --model {model}"
cmd = ['powershell.exe', '-NoProfile', '-Command', ps_command]
try:
env = os.environ.copy()