Tracks total estimated token usage across all turns and replaces the
largest tool results with a placeholder when the soft ceiling is exceeded.
This mirrors Claude Code's ContentReplacementState.
Methods
ContentReplacementState$new()
Create a new state object.
Usage
ContentReplacementState$new(soft_ceiling = .RESOURCE_SOFT_CEILING)ContentReplacementState$maybe_replace()
Check usage and replace large old results if over ceiling.
Arguments
chatAn
ellmer::Chatobject (modified in place).