If you're building anything with LangChain, OpenAI's Python SDK, or LangGraph in
production, you've probably run into the same class of bugs that have been
quietly breaking real apps for months. Over the last week I dug through ~70
open issues across these libraries while doing client debugging work, and there
are five patterns that come up constantly — each with a non-obvious root
cause and a 5-line fix.
Here they are, ranked by how much pain they cause.
1. _create_usage_metadata crashes when service_tier is set and cached_tokens is missing
Repo: langchain-ai/langchain ( #36657 )
The trap:
prompt_details = response . get ( " prompt_details " , {}) prompt_details .…