Skip to content

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

Open
guslegend0510 wants to merge 3 commits into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1484
Open

修复 AutoContext 中 system 消息混入 inputMessages 的问题#1489
guslegend0510 wants to merge 3 commits 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

CLAassistant commented May 25, 2026

CLA assistant check
All committers have signed the CLA.

@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!

@LearningGp
Copy link
Copy Markdown
Collaborator

image

@guslegend0510
Copy link
Copy Markdown
Author

都签署了
image

@AgentScopeJavaBot AgentScopeJavaBot added bug Something isn't working area/ext/memory Memory/session extension implementations labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ext/memory Memory/session extension implementations bug Something isn't working

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

5 participants