You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Include compaction calls in token usage #5404
Need to add the token usage for compaction to the token usage tracked by the Strands SDK.
SDK Language
Both / Not language-specific
Problem Statement
Model.compact() calls the model outside the agent loop, for both the client-side default and native compaction. Anthropic reports native compaction usage in usage.iterations. Neither shows up in agent metrics or traces, so users can't see what summarization costs. The 0022 evals had to add it up by hand.
Proposed Solution
Add each compact() call's usage to the agent's accumulated usage, including usage.iterations for native compaction.
Activity