Skip to content

修复 AutoContext 中 system 消息混入 inputMessages 的问题#1489

Open
guslegend0510 wants to merge 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1484
Open

修复 AutoContext 中 system 消息混入 inputMessages 的问题#1489
guslegend0510 wants to merge 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1484

Conversation

@guslegend0510
Copy link
Copy Markdown

背景

当前 AutoContext 在构造事件时,会把 system 说明和普通输入一起放进 inputMessages。这样容易出现多个 system turn 混杂、上下文语义不清或推理阶段读取冲突的问题。

修改内容

  • 将 system 说明从 inputMessages 中剥离出来。
  • 统一写入 PreReasoningEvent.systemMessage
  • inputMessages 只保留非 system turn,降低后续处理歧义。
  • 避免多 system 消息带来的上下文冲突。

验证

  • mvn -pl agentscope-extensions/agentscope-extensions-autocontext-memory -am -Dtest=AutoContextHookTest test

Fixes #1484

@guslegend0510 guslegend0510 requested a review from a team May 25, 2026 10:20
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 73.68421% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...scope/core/memory/autocontext/AutoContextHook.java 73.68% 1 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

[Bug]:AutoContextHook fails with Qwen3.5-35B-A3B due to ChatML system message constraints

3 participants