Skip to content

feat(harness): add description field to custom subagent factory#1506

Open
chenlinks wants to merge 2 commits into
agentscope-ai:mainfrom
chenlinks:feat/subagent-factory-description
Open

feat(harness): add description field to custom subagent factory#1506
chenlinks wants to merge 2 commits into
agentscope-ai:mainfrom
chenlinks:feat/subagent-factory-description

Conversation

@chenlinks
Copy link
Copy Markdown

SubagentFactoryEntry previously held only a name and factory, so the DynamicSubagentsHook exposed the bare name as the subagent description. Names alone often fail to convey a subagent's function, leaving the orchestrator without useful selection context.

Add an optional description: a new
subagentFactory(name, description, factory) builder overload and a displayDescription() fallback that uses the name when the description is null or blank. The existing two-arg overload is preserved, so callers need no changes.

Closes #1504

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.12, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

Description

[Please describe the background, purpose, changes made, and how to test this PR]

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

SubagentFactoryEntry previously held only a name and factory, so the
DynamicSubagentsHook exposed the bare name as the subagent description.
Names alone often fail to convey a subagent's function, leaving the
orchestrator without useful selection context.

Add an optional description: a new
subagentFactory(name, description, factory) builder overload and a
displayDescription() fallback that uses the name when the description is
null or blank. The existing two-arg overload is preserved, so callers
need no changes.

Closes agentscope-ai#1504
@chenlinks chenlinks requested a review from a team May 27, 2026 03:05
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 27, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...java/io/agentscope/harness/agent/HarnessAgent.java 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/docs Documentation area/harness agentscope-harness (test/runtime support) labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation area/harness agentscope-harness (test/runtime support) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 自定义子智能体工厂类(SubagentFactoryEntry)建议增加描述字段

4 participants