Skip to content

fix(extensions): resolve AutoContextMemory API role compliance#998

Open
jujn wants to merge 1 commit intoagentscope-ai:mainfrom
jujn:fix_997
Open

fix(extensions): resolve AutoContextMemory API role compliance#998
jujn wants to merge 1 commit intoagentscope-ai:mainfrom
jujn:fix_997

Conversation

@jujn
Copy link

@jujn jujn commented Mar 20, 2026

Description

Close #997

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@jujn jujn requested review from a team and Copilot March 20, 2026 04:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.USER and name="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
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 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]:

2 participants