fix(extensions): resolve AutoContextMemory API role compliance#998
fix(extensions): resolve AutoContextMemory API role compliance#998jujn wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes AutoContextMemory’s “current round” compression output to comply with chat API role requirements by ensuring the generated compressed summary message is treated as a USER message (not an ASSISTANT message).
Changes:
- Update current-round compressed summary message construction to use
MsgRole.USERandname="user". - Add a regression test asserting the compressed current-round summary message role/name are USER/user.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agentscope-extensions/agentscope-extensions-autocontext-memory/src/main/java/io/agentscope/core/memory/autocontext/AutoContextMemory.java | Changes the current-round compressed summary message role/name to USER/user for API compliance. |
| agentscope-extensions/agentscope-extensions-autocontext-memory/src/test/java/io/agentscope/core/memory/autocontext/AutoContextMemoryTest.java | Adds a test that verifies the compressed current-round summary message is emitted with USER role and name="user". |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@shiyiyue1102 PTAL |
|
@shiyiyue1102 PTAL |
LearningGp
left a comment
There was a problem hiding this comment.
I don't think simply defaulting to the user role is the best approach here. This information shouldn't all be categorized as user input. We should probably construct valid message pairs based on the actual context after compression.
@shiyiyue1102 PTAL
Thanks for your review! I'm sorry I didn't seriously consider it before. You are completely correct. I noticed that PR #1027 seems to have implemented your suggestion. If you think PR1027 can solve the current problem, please close this PR directly. Thanks. |


Description
Close #997
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)