mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 15:01:15 +00:00
`MessageContent::text_length()` returned 0 for `ToolUse` blocks, ignoring the tool name and JSON input arguments. This caused the compactor's `estimate_token_count()` (which uses `text_length()`) to massively undercount tokens when conversations contained tool calls with large arguments (e.g. web_search results, page content). The result: compaction never triggered despite the session exceeding the context window, leading to "Token limit exceeded" errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>