[MEDIUM] falsify.py: make_subprocess_falsifier silently discards non-zero subprocess exit #8

Closed
opened 2026-05-19 04:42:47 +00:00 by foravo_admin · 1 comment
Owner

Imported from GitHub issue M00C1FER/mesh-review#5.

Source: https://github.com/M00C1FER/mesh-review/issues/5
Original author: @M00C1FER
Original state: closed


Finding 4 — MEDIUM

File: src/mesh_review/review/falsify.py
Function: make_subprocess_falsifier() → inner closure
Commit fixing this: 834f8d8441226ac383868a9cb8ac5c69b650581e (PR #1)

Description

make_subprocess_falsifier calls subprocess.run() but does not check the returncode:

proc = subprocess.run(
    cmd + [prompt], capture_output=True, text=True, timeout=timeout_s
)
# returncode never checked
parsed = _parse_falsifier_output(proc.stdout)

A non-zero exit (CLI error, missing model) causes proc.stdout to be empty or contain error text, which _parse_falsifier_output cannot parse, returning None. This falls through to a generic "model returned unparseable output" error — correct result, but the root cause (non-zero exit / stderr) is lost.

Fix Applied

if proc.returncode != 0:
    return {"falsified": False, "confidence": 0.0,
            "rationale": f"{cli}: exited {proc.returncode}: {proc.stderr.strip()[:200]}"}
Imported from GitHub issue `M00C1FER/mesh-review#5`. Source: https://github.com/M00C1FER/mesh-review/issues/5 Original author: @M00C1FER Original state: closed <!-- foravo:github-issue:M00C1FER/mesh-review#5 --> --- ## Finding 4 — MEDIUM **File:** `src/mesh_review/review/falsify.py` **Function:** `make_subprocess_falsifier()` → inner closure **Commit fixing this:** 834f8d8441226ac383868a9cb8ac5c69b650581e (PR #1) ### Description `make_subprocess_falsifier` calls `subprocess.run()` but does not check the returncode: ```python proc = subprocess.run( cmd + [prompt], capture_output=True, text=True, timeout=timeout_s ) # returncode never checked parsed = _parse_falsifier_output(proc.stdout) ``` A non-zero exit (CLI error, missing model) causes `proc.stdout` to be empty or contain error text, which `_parse_falsifier_output` cannot parse, returning `None`. This falls through to a generic `"model returned unparseable output"` error — correct result, but the root cause (non-zero exit / stderr) is lost. ### Fix Applied ```python if proc.returncode != 0: return {"falsified": False, "confidence": 0.0, "rationale": f"{cli}: exited {proc.returncode}: {proc.stderr.strip()[:200]}"} ```
foravo_admin 2026-05-19 04:42:47 +00:00
Author
Owner

Imported from GitHub issue comment M00C1FER/mesh-review#5:4362220530.

Source: https://github.com/M00C1FER/mesh-review/issues/5#issuecomment-4362220530
Original author: @M00C1FER


Fixed by merged PR #1.

Imported from GitHub issue comment `M00C1FER/mesh-review#5:4362220530`. Source: https://github.com/M00C1FER/mesh-review/issues/5#issuecomment-4362220530 Original author: @M00C1FER <!-- foravo:github-issue-comment:M00C1FER/mesh-review#5:4362220530 --> --- Fixed by merged PR #1.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
foravo/mesh-review-comment-proof-20260519044241#8
No description provided.