wenjin272 opened a new issue, #1355: URL: https://github.com/apache/flink-agents/issues/1355
### Search before asking - [x] I searched the existing issues. #1134 tracks subagent support and #1338 tracks Future/tool execution consolidation; this issue focuses on the developer-facing API boundary. ### Description Developers implementing an external subagent should be able to depend only on `flink-agents-api`, just as they do when implementing `BaseChatModelConnection`. Currently, `SubagentSetup` is in api, but the documented extension bases `BaseDeferredSubagentSetup` and `BaseAsyncSubagentSetup`, together with their parent `BaseSubagentSetup`, are in runtime. Implementing an external subagent through these bases therefore requires a runtime dependency. These classes mix two responsibilities: - Integration contracts: resource configuration, defining a deferred call, submitting a remote run, querying status, fetching results, cancellation, and recovery reconciliation. - Runtime execution management: action lifecycle callbacks, deterministic call identity allocation, pending-handle tracking, durable scheduling, and concrete Future creation. #### Proposed direction - Expose the developer-facing deferred and async subagent extension contracts in api, so an integration can compile without depending on plan or runtime. - Extract runtime execution management from the extension inheritance chain and keep it in runtime. - Reconsider `BaseSubagentSetup` rather than moving it unchanged: common resource definitions can remain in or be consolidated into `SubagentSetup`, while its task lifecycle and bookkeeping belong in runtime. - Keep durable execution and handle management framework-owned. Integration authors should implement their service interaction without manually managing durable submission or runtime Futures. This is a responsibility split, not just a package move. The exact class hierarchy and delegation interface remain to be designed. #### Acceptance criteria - A separate Java integration fixture implements both deferred and async external subagents with `flink-agents-api` as its only Flink Agents dependency. - Runtime tests exercise those implementations through resource registration and invocation, preserving deferred versus eager submission, recovery, failure propagation, cancellation, and handle cleanup. - The dependency direction remains `runtime -> plan -> api`, with no runtime implementation types exposed in the integration contract. - Update the external-subagent documentation and examples, and document any API migration. Review the corresponding Python extension boundary for semantic alignment. ### Are you willing to submit a PR? - [ ] 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]
