Skip to content

Decouple A2A into standalone a2a-elixir package#6

Merged
zeroasterisk merged 2 commits intomainfrom
decouple-a2a-sdk
Mar 9, 2026
Merged

Decouple A2A into standalone a2a-elixir package#6
zeroasterisk merged 2 commits intomainfrom
decouple-a2a-sdk

Conversation

@zeroasterisk
Copy link
Copy Markdown
Owner

Summary

Decouples the A2A protocol implementation into a standalone package at zeroasterisk/a2a-elixir, following the pattern of other language SDKs (Python has google-a2a, Go has its own module).

New package: a2a-elixir

The standalone a2a package provides:

  • Protocol types: A2A.AgentCard, A2A.Task, A2A.TaskStatus, A2A.Message, A2A.Part, A2A.Artifact
  • Client: A2A.Client — fetch agent cards, send/get/cancel tasks
  • Server: A2A.Server — Plug-based JSON-RPC 2.0 server with A2A.Handler callback behaviour
  • Framework-agnostic, no ADK dependency
  • 35 tests, Apache 2.0 license

Changes to ADK Elixir

  • Added {:a2a, github: "zeroasterisk/a2a-elixir"} dependency
  • ADK.A2A.AgentCard — bridges ADK agents to A2A.AgentCard structs
  • ADK.A2A.Client — delegates to A2A.Client (backward compatible API)
  • ADK.A2A.Server — implements A2A.Handler behaviour, delegates to A2A.Server
  • ADK.A2A.Message — adds to_a2a_message/1 bridge, keeps existing functions
  • ADK.A2A.RemoteAgentTool — unchanged (ADK-specific)

Key design decisions

  • Clean separation: A2A SDK works without ADK; ADK depends on A2A, not vice versa
  • Handler behaviour: The A2A server uses a callback-based A2A.Handler behaviour instead of being tied to ADK.Runner
  • Backward compatible: All existing ADK.A2A.* module APIs preserved
  • All 226 tests + 14 doctests pass

Zaf and others added 2 commits March 9, 2026 00:26
## Context Compression (#80)
- ADK.Context.Compressor behaviour with configurable strategies
- Truncate strategy: keeps system + last N messages
- Summarize strategy: uses LLM to condense older messages
- Wired into LlmAgent via context_compressor option
- Configurable threshold before compression kicks in

## Integration Tests (#92)
- test/integration/gemini_api_test.exs with real Gemini API tests
- Single-turn Q&A, multi-turn conversation, tool use round-trip
- Agent transfer, error handling (bad model, invalid request)
- Tagged @tag :integration, excluded by default
- Run with: GEMINI_API_KEY=key mix test --include integration

## MCP Client (#77)
- Already implemented in prior PRs with full test coverage
- Client connects via stdio, performs JSON-RPC initialization
- ToolAdapter converts MCP tools to ADK FunctionTools
- Mock MCP server for testing

## Housekeeping
- Added examples build artifacts to .gitignore
- Add {:a2a, github: "zeroasterisk/a2a-elixir"} dependency
- ADK.A2A.AgentCard now bridges ADK agents to A2A.AgentCard structs
- ADK.A2A.Client delegates to A2A.Client (backward compatible)
- ADK.A2A.Server implements A2A.Handler behaviour, uses A2A.Server
- ADK.A2A.Message adds to_a2a_message/1 bridge function
- ADK.A2A.RemoteAgentTool unchanged (ADK-specific)
- All 226 tests + 14 doctests pass
@zeroasterisk zeroasterisk merged commit 414c621 into main Mar 9, 2026
0 of 4 checks passed
@zeroasterisk zeroasterisk deleted the decouple-a2a-sdk branch March 18, 2026 01:58
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