feat(harness): support per-subagent compaction config - #2378
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
LGTM. Looks good.
Automated review by "github-manager-bot"
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR propagates the parent agent's CompactionConfig into declared subagents built via SubagentDeclaration. Previously, only the general-purpose subagent path inherited compaction settings; declared subagents silently fell back to defaults.
Note: PR title ("add AgentMetrics for performance monitoring") does not match actual changes (compaction config propagation).
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR propagates the parent agent's CompactionConfig into declared subagents built via SubagentDeclaration. Previously, only the general-purpose subagent path inherited compaction settings; declared subagents silently fell back to defaults.
Note: PR title ("add AgentMetrics for performance monitoring") does not match actual changes (compaction config propagation).
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR propagates the parent agent's CompactionConfig into declared subagents built via SubagentDeclaration. Previously, only the general-purpose subagent path inherited compaction settings; declared subagents silently fell back to defaults.
Note: PR title ("add AgentMetrics for performance monitoring") does not match actual changes (compaction config propagation).
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
…bagent-compaction # Conflicts: # agentscope-harness/src/main/java/io/agentscope/harness/agent/subagent/SubagentDeclaration.java # agentscope-harness/src/test/java/io/agentscope/harness/agent/HarnessAgentTest.java
Summary
Fixes #2325.
Declarative subagents could only use their own default compaction behavior because
SubagentDeclarationhad no compaction option and the declared-subagent factory did not propagate the parent setting.This change:
SubagentDeclaration.Builder.compaction(CompactionConfig)for per-subagent configuration;User impact
Callers can configure a declaratively registered subagent with an independent compaction strategy while other subagents continue to inherit the parent behavior.
Tests
mvn -pl agentscope-harness -am -Dtest="HarnessAgentTest,SubagentDeclarationPhaseATest" -Dsurefire.failIfNoSpecifiedTests=false test(44 tests passed)Compatibility and risk
The new builder method is additive. Existing declarations keep inheritance semantics, so no migration is required. The change is limited to local declared-subagent construction; remote task declarations are unaffected.