Skip to content

api: support AG-UI and multiple protocol endpoints per agent - #720

Open
deka wants to merge 3 commits into
agentregistry-dev:mainfrom
deka:feat/agui-protocol
Open

deka wants to merge 3 commits into
agentregistry-dev:mainfrom
deka:feat/agui-protocol

Conversation

@deka

@deka deka commented Dec 2, 2026 •

Copy link
Copy Markdown

Description

Motivation: agents speaking AG-UI (Agent-User Interaction protocol) cannot be declared as such in the registry, and the Agent contract only allows one protocol per image (spec.source.protocol) with no port or path. A frontend using agentregistry as its agent catalog needs to know which agents serve AG-UI and where, including agents that also serve A2A.

What changed (all additive, no API version bump):

  1. AGUI protocol value. AgentProtocolAGUI is accepted by spec.source.protocol.
  2. spec.source.endpoints (optional, Agent). Lists every protocol the image serves, with optional port and path, modeled on MCPTransport.
    • Without endpoints, behavior is unchanged.
    • With both fields set, protocol must be one of the declared endpoints and stays the primary protocol.
    • With only endpoints, validation defaults protocol in place from the first entry, the same way composition ref kinds are defaulted. Clients that only read protocol therefore never wrongly infer A2A.
    • Validation also rejects unknown or duplicated protocols, a missing endpoint protocol, and relative paths.
    • Helpers: AgentSource.PrimaryProtocol(), EffectiveEndpoints() (legacy agents yield one endpoint for their primary protocol) and HasProtocol().
  3. status.runtime.endpoints (optional, Deployment). A {protocol, url} list next to the existing endpoint string, which keeps holding the primary URL. The reconciler persists ApplyResult.Runtime as a whole, so runtimes can fill it without further plumbing.
  4. kagent. Still requires A2A as the primary protocol, now via PrimaryProtocol(). Additional endpoints (e.g. AG-UI) are accepted but not published by this runtime. A custom port or path on the A2A endpoint is rejected, because kagent cannot honor it and would otherwise deploy an unreachable agent.
  5. openapi.yaml regenerated, ui/lib/api regenerated with @hey-api/openapi-ts@0.93.1 (lockfile version), and a commented example added to examples/agent.yaml.

Related issues: Fixes #719

Examples

Legacy agent (unchanged, still valid):

apiVersion: ar.dev/v1alpha1
kind: Agent
metadata:
  name: summarizer
spec:
  source:
    image: ghcr.io/acme/summarizer:v1.0.0
    protocol: A2A        # or omitted: A2A by default

Agent serving both A2A and AG-UI:

apiVersion: ar.dev/v1alpha1
kind: Agent
metadata:
  name: assistant
spec:
  source:
    image: ghcr.io/acme/assistant:v2.0.0
    protocol: A2A                  # primary protocol, read by existing clients
    endpoints:
      - protocol: A2A
      - protocol: AGUI
        port: 8080
        path: /agui

AG-UI-only agent (protocol is defaulted to AGUI on validation):

apiVersion: ar.dev/v1alpha1
kind: Agent
metadata:
  name: copilot-ui-agent
spec:
  source:
    image: ghcr.io/acme/copilot-ui-agent:v1.0.0
    endpoints:
      - protocol: AGUI
        port: 8000
        path: /
# stored as: protocol: AGUI + endpoints [...]

Deployment status shape (contract only; no runtime populates endpoints yet):

status:
  runtime:
    id: assistant
    name: assistant
    endpoint: http://assistant.agents.svc:8080          # primary, unchanged
    endpoints:
      - protocol: A2A
        url: http://assistant.agents.svc:8080
      - protocol: AGUI
        url: http://assistant.agents.svc:8080/agui

Change Type

/kind feature

Changelog

Agents can declare `spec.source.protocol: AGUI` and list every protocol endpoint they serve (protocol, port, path) in the new optional `spec.source.endpoints`; Deployments gain an optional `status.runtime.endpoints` list of per-protocol URLs. Existing `protocol` and `endpoint` fields are unchanged.

Additional Notes

  • Status field is contract-only for now. No runtime fills status.runtime.endpoints in this PR. kagent does not report an agent URL today, and I did not want to guess its A2A URL scheme. Discovered Deployments (patchDiscoveredStatus) also rebuild the runtime status without it. Happy to wire it per runtime in follow-ups, or to drop the status part from this PR if you prefer to land it together with a runtime that populates it.
  • Tested locally: go test ./pkg/api/v1alpha1/ ./pkg/types/ ./pkg/runtimes/kagent/, go build ./..., and go vet on the touched and consuming packages.

Add AGUI to the accepted Agent spec.source.protocol values so agents
exposing an AG-UI (Agent-User Interaction protocol) endpoint can be
registered and discovered by AG-UI clients.

Fixes agentregistry-dev#719

Signed-off-by: deka <dimitri.rayer@gmail.com>
Add optional spec.source.endpoints to Agent so one image can declare
every protocol it serves (e.g. A2A and AG-UI) with its port and path,
and optional status.runtime.endpoints to Deployment for the URL of each
protocol. Both fields are additive: spec.source.protocol and
status.runtime.endpoint keep their meaning, and validation defaults
protocol from the first endpoint so protocol-only readers still see the
primary protocol.

kagent keeps requiring A2A as the primary protocol and rejects a custom
port or path on the A2A endpoint it cannot honor.

Refs agentregistry-dev#719

Signed-off-by: deka <dimitri.rayer@gmail.com>
@deka deka changed the title api: support AG-UI as an agent protocol api: support AG-UI and multiple protocol endpoints per agent Dec 2, 2026
Reject two endpoints that share the same port and path, require endpoint
paths to be plain absolute URL paths (no host, query, fragment or
characters needing escaping), and bound endpoint ports to 1-65535 in the
schema.

kagent exposes a single port per BYO agent, so it now rejects any
endpoint declared on a custom port instead of silently leaving it
unreachable. The example no longer sets a port, so it deploys on kagent.

EffectiveEndpoints returns a copy so callers cannot mutate the spec, and
the unused HasProtocol helper is removed.

Refs agentregistry-dev#719

Signed-off-by: deka <dimitri.rayer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support AG-UI as an agent protocol

1 participant