GitHub user joeyutong added a comment to the discussion: [Feature] Sub-agent 
Resource for Flink Agents - Framework part

Thanks for the proposal. I understand the motivation for providing a unified 
invocation API for internal and external agents. However, I think the current 
`Subagent` abstraction mixes the agent being registered with the capability 
used to invoke it.

>From the user's perspective, an external agent is a black-box invocation 
>target, so `call()` naturally matches its execution boundary. An internal 
>`Agent`, however, is already presented to users through actions, resources, 
>and event-driven execution. Exposing the same `Agent` as a callable sub-agent 
>makes users reason about two public execution models for the same abstraction: 
>it is event-driven when used as a regular `Agent`, but 
>request/response-oriented when used as a sub-agent.

This is not only an internal implementation difference. To understand the 
behavior of `call()`, users also need to know how the request becomes an input 
event, which output events form the result, and what marks the call as 
complete, such as quiescence. In other words, the callable view is exposed to 
users, while the semantic adaptation that creates this view remains implicit.

Therefore, the proposal unifies the invocation shape, but does not fully unify 
the user-facing semantics. From this perspective, the shared abstraction seems 
closer to a `SubagentInvoker`:

- for an external agent, it delegates to the invocation protocol provided by 
the external integration;
- for an internal agent, it invokes the `Agent` through a **`CallProtocol`** 
that defines request, result, and completion mappings.

Under this model, `ResourceType.AGENT` represents the underlying agent 
target—an internal `Agent` in the internal case—while `SubagentInvoker` 
represents the capability used to invoke that target. The internal wrapper can 
remain an implementation detail, but its call protocol should be an explicit 
part of the observable contract.

This would preserve a unified API for callers without exposing `call()` as a 
second intrinsic execution model of every `Agent`.

GitHub link: 
https://github.com/apache/flink-agents/discussions/909#discussioncomment-17661229

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to