@@ -288,14 +288,15 @@ def _call_cli_model(self, prompt: str) -> Optional[str]:
288288 with open (prompt_file , "w" , encoding = "utf-8" ) as f :
289289 f .write (prompt )
290290
291- if self .client_name == "gemini" :
292- # Using shell redirect for 100% reliable capture
293- cmd = f"gemini --model { self .model_name or 'gemini-2.5-flash-lite' } --prompt \" $(cat { prompt_file } )\" > { response_file } 2>/dev/null"
294- subprocess .run (cmd , shell = True , check = True , timeout = 120 ) # nosec B602
295-
296- elif self .client_name == "claude" :
297- cmd = f"claude \" $(cat { prompt_file } )\" > { response_file } 2>/dev/null"
298- subprocess .run (cmd , shell = True , check = True , timeout = 120 ) # nosec B602
291+ with open (response_file , "w" , encoding = "utf-8" ) as f_out :
292+ with open (os .devnull , "w" ) as f_err :
293+ if self .client_name == "gemini" :
294+ cmd = ["gemini" , "--model" , str (self .model_name or "gemini-2.5-flash-lite" ), "--prompt" , prompt ]
295+ subprocess .run (cmd , stdout = f_out , stderr = f_err , check = True , timeout = 120 ) # nosec B603
296+
297+ elif self .client_name == "claude" :
298+ cmd = ["claude" , prompt ]
299+ subprocess .run (cmd , stdout = f_out , stderr = f_err , check = True , timeout = 120 ) # nosec B603
299300
300301 # Read response from buffer
301302 if os .path .exists (response_file ):
0 commit comments