mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-18 18:10:37 +08:00
* fix(context): restore turn cap, serialize content parts and tool calls for llm compress, fix AftCompact debug log Three context-compaction regression fixes after #8226: 1. Restore max_context_length -> enforce_max_turns propagation so normal turn-based truncation works again. 2. Serialize ContentPart and ToolCall objects into plain dicts in _message_to_dict so llm_compress no longer fails with JSON serialization errors. 3. Print _provider_messages (compacted) instead of run_context.messages (unchanged) in AftCompact debug log; truncate long role lists to first4,...,last4 to avoid log spam. Assertions in tests are also hardened to avoid coupling to exact prompt wording. * fix(tool_loop_agent_runner): simplify context handling by removing redundant provider messages * fix(tool_loop_agent_runner): rename context manager variables for clarity * fix: update context compression to use recent token ratio instead of fixed count * fix: enhance LLMSummaryCompressor to sanitize contexts and improve message handling * ruff format --------- Co-authored-by: Soulter <905617992@qq.com>
AstrBot 管理面板
基于 CodedThemes/Berry 模板开发。
环境变量
VITE_ASTRBOT_RELEASE_BASE_URL(可选)- 默认值:
https://github.com/AstrBotDevs/AstrBot/releases - 用途:管理面板内“更新到最新版本”外部跳转所使用的 release 基地址。集成方可按需覆盖(例如 Desktop 指向其自身发布页)。
- 建议传入仓库的
.../releases基地址(不带/latest)。
- 默认值: