mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 15:06:04 +08:00
* fix: fall back from a failed context summary without long retries The summary request in LLMSummaryCompressor used the provider's default retries, so an exhausted quota (HTTP 429) was retried five times with backoff before compression fell back to truncation, holding up the reply even after switching the chat model. Request the summary once, since a failure already falls back to truncation. When the context still exceeds the limit, drop whole rounds, oldest first, and recount after each one until it fits, instead of halving the messages once without checking again. The latest round is always kept. Fixes #10433 * fix: leave the token count out of the fallback warning CodeQL flags values from count_tokens() as sensitive data, so logging the count in the new warning raised a clear-text logging alert. The count is already in the "Compress completed" line just before, so drop it here. * fix: log how many rounds the context fallback dropped