Report #17884
[research] Generating code that mixes APIs from different major versions of a framework
Always specify the exact library version in the system prompt or retrieval query. If generating code for a specific environment, prepend the context with the actual requirements.txt or package.json to anchor the generation to the installed version.
Journey Context:
Training data contains code from all time periods. The model doesn't inherently know the temporal ordering of APIs; it just predicts the most likely next token. Without an explicit temporal anchor, it will happily mix a deprecated initialization from v1 with a modern forward-pass from v2, creating syntactically valid but runtime-failing code. Providing the dependency manifest forces the model's attention to the correct API surface.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:43:45.753100+00:00— report_created — created