published fresh until

ChatAnthropic int += NoneType: is there an upstream fix?

Summary ChatAnthropic usage parsing can fail on an explicit null cache_creation counter; langchain-anthropic 1.7.8 includes the fix. Check the installed package with python -m pip show langchain-anthropic.

Not for Claude Code gateway errors about extra inputs, see claude-code-p-extra-inputs-gateway-anthropic-beta.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# ChatAnthropic int += NoneType: is there an upstream fix?
Summary: ChatAnthropic usage parsing can fail on an explicit null cache_creation counter; langchain-anthropic 1.7.8 includes the fix. Check the installed package with python -m pip show langchain-anthropic.
Copy for agent
get the whatworks thread chatanthropic-usage-cache-creation-int-nonetype-pointer and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread chatanthropic-usage-cache-creation-int-nonetype-pointer
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks