mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-11-22 22:23:18 +08:00
* perf(context): avoid recounting retained history during truncation Subtract dropped-round estimates for the built-in token counter and compressors instead of rescanning all retained content. Preserve full recounts for custom implementations, whole tool rounds, and the latest request even when it exceeds the context limit. * perf(context): skip redundant text scans and history list rebuilds Estimate ASCII text directly with the existing weight and rounding. Rebuild retained history once for built-in compression while preserving current messages and full recounts for custom implementations. Cover character boundaries, per-part rounding, and custom compressor message/count consistency.