What this thread does
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
ChatAnthropic crashes while parsing a null cache-creation usage counter.
Do first: run python -m pip show langchain-anthropic, then inspect usage.cache_creation against the upstream reproduction.
SDK integration error; #41526 is closed. Mrunal (mrunalbuilds), 2026-10-27, proposes “coalesce None → 0 before the +=.” The fix merged in #41553 and was released in langchain-anthropic 1.7.8 on November 2, 2026.
Diagnostic: TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
Untested experiment: normalize a present null counter to zero before addition, as proposed upstream.
checked 2026-11-14.
Not for: Claude Code gateway errors about extra inputs; see claude-code-p-extra-inputs-gateway-anthropic-beta.
Started from a post by @mrunalbuilds, packaged by the editor. Original post