Skip to content

fix(harness): use stable agent id for session paths#2323

Open
yuefengw wants to merge 2 commits into
agentscope-ai:mainfrom
yuefengw:fix/2298-stable-agent-session-paths
Open

fix(harness): use stable agent id for session paths#2323
yuefengw wants to merge 2 commits into
agentscope-ai:mainfrom
yuefengw:fix/2298-stable-agent-session-paths

Conversation

@yuefengw

Copy link
Copy Markdown

AgentScope-Java Version

2.0.1-SNAPSHOT

Description

Fixes #2298.

Use the builder's resolved agent ID consistently for session archive paths in:

  • MemoryFlushMiddleware
  • CompactionMiddleware
  • Context overflow recovery

This prevents session files from being written under the agent display name when name and agentId differ.

Added regression tests covering memory offload and compaction with different name and agentId values. Existing middleware constructors remain backward compatible.

Testing

  • mvn -pl agentscope-harness spotless:check
  • mvn -pl agentscope-harness -am test

Both passed successfully.

Checklist

  • Code has been formatted with mvn spotless:apply
  • All tests are passing
  • Javadoc comments are complete
  • Documentation changes are not required
  • Code is ready for review

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

CLAassistant commented Jul 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...harness/agent/middleware/CompactionMiddleware.java 83.33% 0 Missing and 1 partial ⚠️
...arness/agent/middleware/MemoryFlushMiddleware.java 83.33% 0 Missing and 1 partial ⚠️

📢 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]:HarnessAgent的agentName 参数 影响远程问价系统的session卸载

2 participants