Skip to content

feat: add A2A transport binding#10

Merged
maxekman merged 4 commits intomainfrom
feature/a2a-transport
Mar 24, 2026
Merged

feat: add A2A transport binding#10
maxekman merged 4 commits intomainfrom
feature/a2a-transport

Conversation

@maxekman
Copy link
Copy Markdown
Contributor

Description

Add A2A (Agent-to-Agent) protocol as a transport for A2UI, enabling agents
to be served and consumed over HTTP via the A2A protocol.

  • A2UI.A2A — server-side macro wrapping an A2UI agent as an A2A agent
  • A2UI.Transport.A2A — client-side transport connecting LiveViews to remote agents
  • A2UI.A2A.Delivery — minimal transport for agent→handler message delivery
  • Sync fence ({:a2ui_sync, pid, ref}) in A2UI.Agent for reliable message collection
  • Catalog validation now accepts custom component_modules types
  • Demo page at /a2a showing the same agent over A2A transport

Steps to reproduce

mix test    # 400 tests, 0 failures
mix a2ui.demo
# http://localhost:4002     → Local transport
# http://localhost:4002/a2a → A2A transport

Environment

  • Elixir: ~> 1.17
  • OTP: 27
  • a2ui version: 0.1.0

@claude
Copy link
Copy Markdown

claude bot commented Mar 24, 2026

Reviewed — one high-confidence issue found.

Unhandled {:a2ui_transport_error, reason} crashes the LiveView on any A2A network error

A2UI.Transport.A2A sends {:a2ui_transport_error, reason} to the LiveView on HTTP failures (both in init_handler/3 and handler_loop/3). use A2UI.Live only injects a handle_info for {:a2ui_message, msg}, so this message is unhandled, causing a FunctionClauseError and a LiveView crash. The demo A2ALive also has no clause for it.

Fix options:

  • Add a handle_info({:a2ui_transport_error, reason}, socket) clause to the use A2UI.Live macro (log + noreply), or
  • Have the transport deliver errors as a typed {:a2ui_message, ...} so the existing handler picks them up.

@maxekman maxekman force-pushed the feature/a2a-transport branch 4 times, most recently from 735aba2 to fbeb4ce Compare March 24, 2026 16:17
Server side: A2UI.A2A macro wraps an A2UI.Agent as an A2A.Agent,
translating Part.Data ↔ A2UI messages with sync fence collection.
Client side: A2UI.Transport.A2A connects LiveViews to remote A2UI
agents over A2A protocol with async handler process.
Types registered via component_modules config are now treated
as valid by Catalog.validate_types/2, fixing StatusBadge
rejection in the demo's confirmation screen.
Add mix precommit alias (compile --warnings-as-errors,
deps.unlock --unused, format, test, bun test).
@maxekman maxekman force-pushed the feature/a2a-transport branch from fbeb4ce to 7196838 Compare March 24, 2026 16:24
@maxekman
Copy link
Copy Markdown
Contributor Author

Fixed — added handle_info({:a2ui_transport_error, reason}, socket) to the use A2UI.Live macro. Logs the error and returns {:noreply, socket}, matching the pattern of all other error handlers in the module.

@maxekman maxekman merged commit 83532ca into main Mar 24, 2026
7 checks passed
@maxekman maxekman deleted the feature/a2a-transport branch March 24, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant