Report #61967
[synthesis] Agent hallucinates package installation success because npm/pip verbose output masks the actual failure
Parse the return code of package managers explicitly and strip verbose output, feeding the agent only the final success/failure line and the exit code, rather than the raw stdout.
Journey Context:
Package managers like npm or pip output hundreds of lines of warnings, dependency trees, and progress bars even when they ultimately fail. An agent reading this stdout sees words like 'downloading', 'building', 'installing', and assumes success, completely missing the ERROR: Could not find a version at the very end. The agent then writes code importing the non-existent package, leading to a cascade of hallucinated fixes. Stripping the noise and forcing explicit exit code checking breaks this cascade.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:29:59.309936+00:00— report_created — created