[Feature] Expose sub-agents to chat models as callable tools
- Dominant language
- Java
- Stars
- 452
- Forks
- 167
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 49
Description
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/flink-agents/issues) and found nothing similar.
### Description
This is a sub-increment of the sub-agent work already designed in #909 and scoped in #1082 — specifically the "chat-model tool calls" step that #1082 listed as a later deliverable. The framework and `AGENT` resource type landed in #938; the remaining work is being split into several sub-issues/PRs, and this one covers exposing declared sub-agents to the chat model as callable tools, so the model can delegate a sub-task to a sub-agent the way it calls a function.
As agreed in #909, this reuses the existing tool-call dispatch path (`ToolCallAction`): internally the same durable `submit` / `await` sub-agent invocation, wrapped by the chat model's ReAct-style loop. Full Java/Python parity.
### Scope
- Sub-agent callables are advertised under a reserved `subagent_` prefix, keeping the `AGENT` and `TOOL` namespaces distinct; a chat-model setup declares its delegatable sub-agents via a `subagents` argument.
- A sub-agent is exposed only if it can produce a JSON input schema (explicit or derived from its input type); otherwise it is skipped. Cross-language bridge handles are rejected.
- Dispatch stays durable; results are normalized to JSON-compatible content, and a failed sub-agent returns its reason to the model instead of failing the job.
This is one of several sub-issues/PRs splitting the sub-agent roadmap; it does not add a built-in internal sub-agent (a separate track). End-to-end out-of-the-box UX lands when that track completes.
### References
- Design discussion: #909
- Parent feature issue: #1082
- Framework PR: #938
- Background: #660
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Contributor guide
Assessment
This issue has not been assessed yet.