修复 AutoContext 中 system 消息混入 inputMessages 的问题#1489
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
PTAL @shiyiyue1102 |
# Conflicts: # agentscope-extensions/agentscope-extensions-autocontext-memory/src/main/java/io/agentscope/core/memory/autocontext/AutoContextHook.java # agentscope-extensions/agentscope-extensions-autocontext-memory/src/test/java/io/agentscope/core/memory/autocontext/AutoContextHookTest.java
edee18f to
db740c4
Compare
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR changes 2 lines in ToolCallParam.java (copy-builder constructor and its Javadoc) and 9 lines in ToolCallParamTest.java (updated assertions). The actual code change fixes the copy-builder Builder(ToolCallParam source) to reference the renamed field runtimeContext instead of the stale name context, and updates the Javadoc immutable-fields list to match. The test changes strengthen assertions from assertEquals on the deprecated getContext() to assertSame on the canonical getRuntimeContext(), plus add null-path coverage.
However, the PR title and description claim to fix "AutoContext system message mixing into inputMessages." No class named AutoContext exists anywhere in the codebase, and none of the changed code relates to system messages or inputMessages. The diff exclusively addresses a field-name rename oversight in the ToolCallParam copy builder. The PR description is misleading.
|
@shiyiyue1102 麻烦审核一下,谢谢您 |


背景
当前 AutoContext 在构造事件时,会把 system 说明和普通输入一起放进
inputMessages。这样容易出现多个 system turn 混杂、上下文语义不清或推理阶段读取冲突的问题。修改内容
inputMessages中剥离出来。PreReasoningEvent.systemMessage。inputMessages只保留非 system turn,降低后续处理歧义。验证
mvn -pl agentscope-extensions/agentscope-extensions-autocontext-memory -am -Dtest=AutoContextHookTest testFixes #1484