Skip to content

fix(harness): propagate memoryConfig to general-purpose subagent - #2616

Open
dangzitou wants to merge 10 commits into
agentscope-ai:mainfrom
dangzitou:chore/fix-general-purpose-memory-config-propagation
Open

fix(harness): propagate memoryConfig to general-purpose subagent#2616
dangzitou wants to merge 10 commits into
agentscope-ai:mainfrom
dangzitou:chore/fix-general-purpose-memory-config-propagation

Conversation

@dangzitou

@dangzitou dangzitou commented Aug 7, 2026

Copy link
Copy Markdown

Issue

Fixes #2549

Describe the background, purpose, changes made, and how to test this PR

When building a general-purpose subagent, HarnessAgentBuilderSupport did not propagate memoryConfig from the root builder into the generated subagent factory. This causes behavior drift versus explicitly configured memory settings.

Changes

  • Capture HarnessAgent.Builder#memoryConfig into a local final variable.
  • Pass the captured config into the general-purpose subagent via sub.memory(capturedMemoryConfig) during construction.

Acceptance report

  • GitHub Java CI build passed on Ubuntu.
  • GitHub Java CI build passed on Windows.
  • Check License and Check Module Sync passed.
  • Codecov reports all modified and coverable lines covered by tests.
  • PR title follows the repository conventional-commit style: fix(harness): propagate memoryConfig to general-purpose subagent.
  • license/cla remains pending until the contributor signs the CLA.

How to test

  • Create a harness with a general-purpose subagent and memory settings.
  • Verify the general-purpose subagent observes the configured memory strategy and limits.

Checklist

  • Code has been formatted with mvn spotless:apply.
  • All GitHub CI tests are passing.
  • The changed behavior is covered by the passing CI and Codecov checks.
  • Javadoc comments are complete and follow project conventions.
  • Related documentation has been updated.
  • Code is ready for maintainer review.

Copilot AI review requested due to automatic review settings August 7, 2026 17:33
@CLAassistant

CLAassistant commented Aug 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a configuration propagation gap in the harness subagent construction path: the built-in general-purpose subagent now inherits the parent HarnessAgent.Builder’s memoryConfig, preventing behavior drift from explicitly configured long-term memory settings.

Changes:

  • Capture HarnessAgent.Builder#memoryConfig when building the general-purpose SubagentFactory.
  • Apply the captured config to the generated subagent via sub.memory(capturedMemoryConfig).

PR title note (conventional commits): The current title includes quotes and doesn’t follow the type(scope): description format; consider something like fix(harness): propagate memoryConfig to general-purpose subagent.

Comment on lines +360 to +361
if (capturedGenOpts != null) sub.generateOptions(capturedGenOpts);
if (capturedMemoryConfig != null) sub.memory(capturedMemoryConfig);
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@oss-maintainer

Copy link
Copy Markdown
Collaborator

CLA Not Signed

The Contributor License Agreement (CLA) check is currently pending on this PR (license/cla: Contributor License Agreement is not signed yet.). This PR cannot be merged until the CLA is signed.

@dangzitou please sign the CLA via the CLA assistant badge in the comment above, or visit https://cla-assistant.io/agentscope-ai/agentscope-java. Once signed, the license/cla status will turn green.


Automated check by github-manager-bot

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

LGTM — code changes look good, but this PR cannot be approved/merged until the contributor signs the CLA (see the CLA reminder comment above).


Automated review by github-manager-bot

@dangzitou dangzitou changed the title Propagate memoryConfig into general-purpose subagent fix(harness): propagate memoryConfig to general-purpose subagent Aug 9, 2026
@zouyx

zouyx commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

I think your PR the same as #2611 generally.
But #2611 pass memoryConfig into declared sub-agent as pr change.
So i prefer to merge #2611 , what do you think?

@zouyx zouyx self-assigned this Aug 10, 2026
@AgentScopeJavaBot AgentScopeJavaBot added bug Something isn't working area/harness agentscope-harness (test/runtime support) labels Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/harness agentscope-harness (test/runtime support) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: general-purpose 子智能体仅继承部分 Memory 状态,未继承父 Agent 的 MemoryConfig

6 participants