GitHub user pltbkd added a comment to the discussion: [Feature] Sub-agent Resource for Flink Agents - Framework part
The sub-agent design is currently being discussed mainly on the imperative invocation model. This lets the main agent post-process results more easily and simplifies main-action development. For composite orchestration, my understanding is that the native workflow orchestration already covers it — a sub-agent resource could act as a subgraph there, but expanding it (if internal) and writing it together with the whole workflow is essentially equivalent. The ChatModel-invokes-subagent work we are doing in parallel reuses ToolCallAction: internally it still uses the imperative sub-agent invocation, while the outside is ReAct-loop action orchestration. A similar approach can reduce composite orchestration to imperative invocation + action orchestration. The fan-in/fan-out action orchestration pattern is generic and orthogonal to sub-agents — the existing ParallelChatRequestExample already does something similar. I've updated the PR code based on the recent discussion. The interface is now in submit + await form; call can be seen as the composed submit + await action, so it does not conflict with the current model. Two new base classes are added: BaseDeferredSubagentSetup and BaseAsyncSubagentSetup. The former is similar to Option B: execution is deferred until triggered at await, which preserves the ability to batch-execute — the batch support is planned to build on #926. The latter is similar to Option C: the caller-facing surface is still submit/isDone/await, while developers get primitives that match the external sub-agent lifecycle: submitRequest, reconcileSubmitRequest, queryStatus, fetchResult. Since submitRequest has side effects while the other primitives are typically idempotent reads, only submitRequest is wired to a reconcile hook. This version also provides an initial implementation of cancel. The code may still need polishing, but it should be readable and discussable in its current state — please take a look when convenient. Looking forward to your feedback. @alnzng @weiqingy @joeyutong @ofekron GitHub link: https://github.com/apache/flink-agents/discussions/909#discussioncomment-17925628 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
