Skip to content

feat(agentic): preserve agent argument descriptions - #6241

Merged
mariofusco merged 8 commits into
langchain4j:mainfrom
CryoThrust:cryothrust-6227-agent-argument-description
Sep 1, 2026
Merged

mariofusco merged 8 commits into
langchain4j:mainfrom
CryoThrust:cryothrust-6227-agent-argument-description

Conversation

@CryoThrust

Copy link
Copy Markdown
Contributor

Closes #6227

Summary

  • preserve optional parameter descriptions in AgentArgument while keeping existing constructors
  • propagate @p(description/value) into agent arguments
  • preserve MCP tool input schema descriptions for MCP agent arguments
  • append - description in supervisor cards only when a description is present
  • add focused regression coverage for @p description propagation

Verification

  • git diff --check passes
  • Maven compile/test is currently blocked by the configured artifact repositories: the gitflow incremental builder extension cannot be resolved (HTTP blocker/internal repository TLS or availability).

The implementation keeps the existing output unchanged for arguments without descriptions and retains a default method on the MCP internal interface for compatibility.

@CryoThrust
CryoThrust force-pushed the cryothrust-6227-agent-argument-description branch 3 times, most recently from 4d4591c to be5cbca Compare September 1, 2026 02:07
@CryoThrust
CryoThrust force-pushed the cryothrust-6227-agent-argument-description branch from be5cbca to 6b31c44 Compare September 1, 2026 02:12
@CryoThrust

Copy link
Copy Markdown
Contributor Author

All CI checks are now green, including Spotless, JDK 17/21/25 compile and unit tests, split-package detection, compliance, and the JDK 21 integration suite. The latest revision also covers @P(name = ...) resolution in the agentic argument path. Ready for review.

@CryoThrust CryoThrust mentioned this pull request Sep 1, 2026
5 of 8 tasks

@mariofusco mariofusco 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.

Please add in SupervisorAgentIT at least one integration test that leverages this new feature. I'm mostly concerned of the fact that the PlannerAgent may not understand what is the argument name when a description is also added and if so we may need to tweak its SystemMessage.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Added the requested integration coverage in SupervisorAgentIT: the classifier sub-agent now uses @P(name = "request", description = "The complete end-user request to categorize"), and the existing supervisor routing assertion exercises the Planner with the described argument. This verifies that the Planner can still resolve the explicit argument name when a description is present.

I could not run Maven locally because the configured internal repository currently cannot resolve gitflow-incremental-builder:4.6.0; the change is limited to the existing integration test.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Applied the repository Palantir Java Format to SupervisorAgentIT.java after the requested integration coverage. The formatting-only changes are included so the Spotless gate can pass.

mariofusco
mariofusco previously approved these changes Sep 1, 2026
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.

[FEATURE] Give AgentArgument a description, so per-parameter documentation can reach the planner

2 participants