Jafar Uruç

AI failure mode #1: shelling out to Python

2026-08-14

Sometimes I look at code generated by clankers and think, WTF? I’ll start recording these failures in blog posts.

result = subprocess.run(
    ["uv", "run", "python", "-m", ...],
    cwd=_REPO_ROOT,
    check=False,
)

It's shelling out through uv just to start another Python process 🤷‍♂️ to get a function’s output rather than importing that file and calling the function directly...

Another instance I have seen a lot is when it tries to use ros2 cli interface rather than just importing ros2cli or using rclpy. This is an actual piece of code that was pushed...

try:
    completed = subprocess.run(
        ["ros2", "topic", "echo", "--once", "--no-arr", topic],
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL,
        timeout=...,
        check=False,
    )
except subprocess.TimeoutExpired:
    return 1

You can search github to see how much slop is being pushed.

#llms #ai-slop