Skip to content

[Tech Debt] Unify sub-agent declarations with generic resource descriptors #1241

Closed

Description

@wenjin272

Search before asking

  • I searched the issues and found no existing issue for this refactoring.

Description

Internal sub-agents currently have a dedicated Java InternalSubagentProvider and a different Python serialized-resource representation. Provider serialization, runtime ownership detection, and setup construction therefore need sub-agent-specific branches. SubagentSetup also extends SerializableResource even though runtime setups are reconstructed from configuration.

Align sub-agent declarations with the existing resource model:

  • Keep addResource / add_resource, ordinary ResourceDescriptors, and generic resource providers.
  • Provide Java/Python InternalSubagent.builder() helpers that return a descriptor containing the child Agent, description, and input schema. Normalize the direct-Agent registration shorthand at the API boundary.
  • Compile the Agent in the plan layer, retain cycle detection and resource-name scopes, and carry the compiled workflow as JSON data under plan.
  • Construct InternalSubagentSetup through the generic provider and the normal descriptor/context constructor. Make SubagentSetup a Resource; external sub-agents must be declared with descriptors instead of setup instances.
  • Preserve internal execution, nested calls, failure results, and Python task lifecycle forwarding. Cover descriptor metadata and plan JSON in both language directions.

The generic ResourceDescriptor should remain unchanged; child-plan compilation belongs in the plan layer. This refactoring does not add Python-to-Java external sub-agent invocation support or change the JDK requirements for Java internal calls.

Related: #1134. Cross-language external invocation remains tracked separately in #1141.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    tech debt[Issue Type] User-unaware issues, such as code refactor and infrastructure maintenance.
    priority/majorDefault priority of the PR or issue.
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixVersion/0.4.0priority/majorDefault priority of the PR or issue.tech debt[Issue Type] User-unaware issues, such as code refactor and infrastructure maintenance.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions