Diagnose AI coding assistant patches that fail because a suggested command, package manager, or local binary is missing from PATH.
Symptom
An AI coding assistant proposes a valid-looking command, but the terminal fails before tests or builds can run.
sh: pnpm: command not found
make: command not found
python: command not found
Likely Cause
The agent inferred a toolchain from project files or previous context, but the current machine does not have that binary installed, the binary is outside PATH, or the shell is running in a different environment than the developer usually uses.
Fast Fix
- Check the project lockfile and scripts before accepting the agent's package-manager guess.
- Run
command -v <tool>or the platform equivalent to verify the binary exists. - Prefer repository scripts such as
npm test,composer test, orvendor/bin/phpunitwhen available. - If the tool is project-local, call it through the package runner or local binary path.
Verification
After fixing the command, rerun the exact failing command from the same working directory and shell. Then run the smallest relevant test target before asking the agent for another patch.
Prevention
Add a short development command section to the repository README and keep CI scripts close to local scripts. AI coding agents perform much better when the canonical commands are discoverable in the repo.