SIGN IN SIGN UP

fix: accumulate usage tokens across follow-up turns

usage_metadata.update() was replacing token counts each turn, so
follow-ups overwrote the initial turn's stats. Now numeric token
fields (input_tokens, output_tokens, cache_creation_input_tokens,
cache_read_input_tokens) are summed across turns while other metadata
fields are still replaced with the latest value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
K
kalil0321 committed
6a5343497b1fb5ee87fd1bca98cdb15969d98eff
Parent: 9d3332a