It wrote a call your library doesn't have
You ask the agent to combine two tables in your pandas script `merge.py`. It writes tidy code using `df.append(other)` and reports it's done. You run it:
`AttributeError: 'DataFrame' object has no attribute 'append'`
The code looks like countless examples online. So why does it fail on your machine?
It writes from memory, not from your project
The model behind the agent learned from a huge snapshot of public code, collected up to a cutoff date. It knows nothing released after that date. Within the snapshot, older library versions dominate because they had years to pile up examples. Unless it checks, the agent doesn't know which version your project installed. So it writes what feels familiar for some version, not necessarily yours. That can be an old call (`df.append` was removed in pandas 2.0), a call from a newer version than the one you have, or a name blended from similar libraries that never existed.
Point it at the truth, not its memory
1. Find the installed version: look in the lockfile, or run `pip show <package>` / `npm ls <package>`.
2. State that version in your request.
3. Name a source of truth. That can be that version's official docs, or the package's own code installed in your project (`node_modules/`, or the Python environment folder). For a terminal tool, use its manual (`man <tool>`) or `<tool> --help`.
4. Ask it to check every function, option or flag it uses against that source, and to tell you where it found each one.
5. On errors like 'no attribute', 'unexpected keyword' or 'unknown option', suspect this first.
An invented option
You ask: 'fetch the page with 3 retries'. The agent writes `requests.get(url, retries=3)`. It reads naturally, but `requests.get` has no `retries` option. Running it fails with `TypeError: ... unexpected keyword argument 'retries'`. Replying 'are you sure?' often just gets another confident guess from the same memory. Better: 'Look in the installed `requests` code for how retries are set up, tell me the file you found it in, then change the code.'
Version first, then a checked fix
Look up the version yourself and hand it over. Then make the agent check the installed library before editing. Notice it reports what it checked, not what it remembers. Then run the script again yourself.
$ pip show pandas
Name: pandas
Version: 2.2.2
▸ You: We have pandas 2.2.2. Before fixing
merge.py, check the installed pandas
for the right way to stack two tables.
⚙ Run: python -c "import pandas as pd;
print(hasattr(pd.DataFrame, 'append'))"
⚙ Run: python -c "import pandas as pd;
help(pd.concat)"
◂ Agent: Checked installed pandas 2.2.2:
DataFrame has no append (the check
printed False). pd.concat exists. I'll
replace the append call with
pd.concat([df, other]).
Recap
An agent writes code from its memory of public code, mostly older versions, not from what your project has installed. It can be off in either direction: too old or too new. Give it your exact version. Make it check every call against that version's docs or installed source and say where it found it.
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.