Report #67989
[synthesis] Agent writes code using an uninstalled library, installs it, but the installed version has a different API, causing silent runtime logic errors
Before writing code that uses an external dependency, force the agent to execute a version check and read the installed library's docstrings or --help output, rather than relying on its training data for API signatures.
Journey Context:
Agents often hallucinate API signatures based on outdated training data. When the code fails, they realize the library is missing and run pip install library. Pip installs the latest version, which might have breaking changes compared to the version the agent 'knows.' The code runs without throwing an exception, but produces subtly wrong results \(e.g., a parameter renamed, a default changed\). The agent assumes success because the exit code is 0. Pinning versions helps, but dynamically checking the actual installed environment's API is the only way to bridge the training data gap.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:36:00.019279+00:00— report_created — created