Skip to content

fix: 合并判断模型上下文数量配置#23

Open
Sisyphbaous-DT-Project wants to merge 2 commits into
advent259141:masterfrom
Sisyphbaous-DT-Project:fix/heartflow-judge-context-count
Open

fix: 合并判断模型上下文数量配置#23
Sisyphbaous-DT-Project wants to merge 2 commits into
advent259141:masterfrom
Sisyphbaous-DT-Project:fix/heartflow-judge-context-count

Conversation

@Sisyphbaous-DT-Project
Copy link
Copy Markdown

@Sisyphbaous-DT-Project Sisyphbaous-DT-Project commented Apr 26, 2026

修改内容

修复 judge_context_count 配置未按文案生效的问题,并合并重复的上下文数量配置。

主要改动:

  1. 删除插件配置 UI 中重复的 context_messages_count
  2. 统一使用 judge_context_count 控制判断模型参考的最近聊天记录数量。
  3. 停止同时向判断模型传入 prompt 历史和 Provider contexts,避免重复上下文。
  4. 保留 prompt 中带发送者名称的群聊历史格式。
  5. 兼容旧配置中的 context_messages_count,取 judge_context_count 和旧值的最大值,避免老用户升级后历史窗口变小。
  6. 修复 judge_context_count <= 0 时可能误取全量历史的问题。
  7. 为原始消息 buffer 设置最小容量,避免历史缓存失效。
  8. 同步更新 README 配置说明。

问题原因

旧版本中,judge_context_count 在配置页面显示为“传入判断模型的上下文条数”,但实际判断历史数量主要由 context_messages_count 控制,导致配置项文案和实际行为不一致。

同时,判断模型调用时已经把最近聊天记录写入 prompt,又额外通过 contexts 传入历史。AstrBot Provider 会将 prompt 追加到 contexts,因此存在重复上下文风险。

兼容性

保留对旧配置 context_messages_count 的临时兼容读取,并取新旧两个配置值的最大值,避免已有用户升级后判断模型参考的历史条数减少。

测试情况

  • 已确认 judge_context_count 正常控制 prompt 中的最近聊天记录数量。
  • 已确认 judge_context_count = 0 时不会误取全量历史。
  • 已确认判断模型调用时 contexts 为空,不再重复传入上下文。
  • 已确认 README 中配置项已同步更新。

@Sisyphbaous-DT-Project Sisyphbaous-DT-Project changed the title fix: unify Heartflow judge context count config 修复 Heartflow 判断模型历史条数配置接线问题 Apr 26, 2026
@Sisyphbaous-DT-Project Sisyphbaous-DT-Project changed the title 修复 Heartflow 判断模型历史条数配置接线问题 fix: 合并判断模型上下文数量配置 Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant