ag-ui-protocol / ag-ui-protocol/ag-ui

Auto-discover AgentCapabilities from the wrapped ADK agent (opt-in)

Open
#2,107 1 comment 0 reactions 0 assignees View on GitHub
enhancement Integration
Dominant language
Python
Stars
15.9k
Forks
1.4k
Avg merge
1d 17h
Merged PRs (30d)
163

Description

## Feature request: auto-discover `AgentCapabilities` from the wrapped ADK agent

`ag-ui-adk` already exposes `GET /capabilities` (via `add_adk_fastapi_endpoint`) and `ADKAgent.get_capabilities()`, but today that only returns whatever dict the developer hand-wrote into the `capabilities=` constructor arg — otherwise `None`. The middleware **knows** a lot about the agent it wraps (name, description, sub-agents, planner, tools) yet derives nothing from it. So an agent that clearly supports multi-agent delegation, reasoning, and human-in-the-loop advertises `{}` unless the developer manually restates all of it — which is easy to forget and drifts out of sync with the actual agent.

### Proposal

Add an opt-in `discover_capabilities: bool = False` flag to `ADKAgent` / `ADKAgent.create(...)`. When enabled, `get_capabilities()` derives a best-effort `AgentCapabilities` by structurally inspecting the wrapped ADK agent (no run needed), then **merges it under** any explicitly-configured `capabilities` — the developer's explicit values always win (one level deep). Flag off → behavior is 100% unchanged (`None` or exactly the configured dict).

Mapping (all `getattr`-guarded so `SequentialAgent` / custom `BaseAgent` roots degrade gracefully):

| Derived key | Source on the ADK agent |
|---|---|
| `identity.{name,description}` + `identity.type: "google-adk"` | `agent.name`, `agent.description` |
| `multiAgent.{supported, subAgents[]}` | `agent.sub_agents` |
| `reasoning.{supported, streaming}` | planner with `thinking_config.include_thoughts` |
| `tools.supported` | non-empty `agent.tools` |
| `humanInTheLoop.supported` | an `AGUIToolset` present in `agent.tools` |
| `transport.streaming` | always `True` (middleware serves SSE) |

### Why

- **Zero-config discovery** — a frontend or agent marketplace can hit `GET /capabilities` and learn the agent is multi-agent / reasoning / HITL-capable without the developer hand-maintaining the dict.
- **No drift** — capabilities track the actual agent structure instead of a stale hand-written copy.
- **Fully backward compatible** — opt-in flag, explicit config still wins per sub-key.

Happy to submit the PR (implementation + tests are ready) — opening the issue first to confirm the derivation mapping (especially the `identity.type: "google-adk"` value and the "explicit-wins one-level-deep" merge semantics) matches what maintainers want.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.