Skip to content

Commit 5276d9b

Browse files
author
jzhu
committed
fix: check command return code before parsing model output to avoid parsing error messages as models
1 parent 3af0ea6 commit 5276d9b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

code_assistant_manager/endpoints.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,13 @@ def fetch_models(
280280
)
281281

282282
output = result.stdout.strip()
283-
if not output and result.stderr:
284-
print(f"Warning: Command returned error: {result.stderr}")
283+
if result.returncode != 0:
284+
print(f"Warning: Command failed with return code {result.returncode}")
285+
if result.stderr:
286+
print(f"Command stderr: {result.stderr}")
287+
return True, models
288+
if not output:
289+
print("Warning: Command returned no output")
285290
return True, models
286291

287292
# Parse output

0 commit comments

Comments
 (0)