Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Training cutoff and API drift
card 1 of 6
Green tests, API from another version
builds on: Why agents fill gaps with plausible guesses
Your `poetry.lock` pins Pydantic 2.7. You ask the agent to reject non-positive order quantities. It adds a validator, runs the tests, and they come back green. It never opened the lockfile. The code uses `@validator`, the Pydantic 1 decorator, and the test log shows a deprecation warning that nobody reads. Why did it reach for an API from the previous major version?
Terms on this card
- lockfile
- A generated file (poetry.lock, package-lock.json, Cargo.lock) recording the exact dependency versions your project installs. In Go, go.mod fixes the versions and go.sum stores their checksums.
- poetry.lock
- The lockfile of Poetry, a Python dependency manager. It lists the exact package versions installed.
- Pydantic
- A Python library for validating data with typed model classes. Version 2 renamed many version 1 APIs.
- decorator
- In Python, a line like @validator(...) placed above a function that wraps or registers it.
- deprecation warning
- A runtime or compiler message saying an API still works but is scheduled for removal in a future version.
Lesson goal: Explain that a model's library knowledge is frozen at training time and blended across versions. It therefore defaults to whatever was most common in its training data, not to the version in your lockfile. Predict when this will bite (fast-moving libraries, recent major versions) and how to counter it: state the versions, and point the agent at the installed docs, type definitions or the lockfile. ·
the whole lesson