[RFC] AstrBot Context 管理升级路线(基于 #6625 与 #6259) #6667
Jacobinwwey
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
建议把变更内容详细说下,突出重点,看完整的代码变更很费劲废时间,最好先交流想法 比如 L0: 短期工作记忆: Recent N turns + tool结果去重(https://github.com/AstrBotDevs/AstrBot/pull/6259) 可以详细展开为: 解决 AI 调用工具报错,但是还是反复使用相同 args 调用相同 tool 占用 context 的问题 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
讨论目标
1) #6259:Tool Loop 上下文膨胀治理
问题 A:相同
tool + args连续失败,模型还在重复调用示例
xx_api(args=a)报错。xx_api(args=a),错误持续堆叠进 context。措施
tool_name + normalized_args计数错误次数。配置
provider_settings.tool_error_repeat_guard_threshold(默认8,<=0关闭)问题 B:相同
tool + args + result被重复写入 context示例
措施
配置
provider_settings.deduplicate_repeated_tool_results=trueprovider_settings.tool_result_dedup_max_entries=1024(<=0不裁剪)问题 C:参数缺失/不匹配导致 handler 层噪声报错
措施
required/anyOf/oneOf+ 参数归一化 + 类型归一化)。TypeError。2) #6625:会话本体压缩治理
问题:仅在超限时压缩,长会话治理滞后
措施
/ctxcompact status、/ctxcompact run [limit]。关键默认值(保守)
periodic_context_compaction.enabled=falsecompact_context_after_tool_call=falsecontext_token_counter_mode=estimate本讨论希望确认的 3 个点
tool_error_repeat_guard_threshold=8是否合适?0.3)是否合理?想听听大家关于context manage的构想和期望
Beta Was this translation helpful? Give feedback.
All reactions