wenjin272 opened a new issue, #1241: URL: https://github.com/apache/flink-agents/issues/1241
### Search before asking - [x] 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 `ResourceDescriptor`s, 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? - [x] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
