refactor: Replace custom A2A code with ADK client implementation#138
refactor: Replace custom A2A code with ADK client implementation#138
Conversation
- Remove 500+ lines of unnecessary conversion code - Update A2AClientInterface to use ADK types directly - Eliminate redundant convertExternalAgentCard, convertToExternalMessageSendParams functions - Simplify client implementation by using ADK client methods directly - Update agent.go to use ADK types (Task, TaskState, SendMessageRequest, etc.) - Fix API routes to handle ADK types - Consolidate error handling and reduce function complexity This refactoring significantly reduces code complexity while maintaining the same functionality. The A2A middleware continues to work as expected with the simplified implementation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
@claude please fix the CI issues, you should use tasks to generate the mocks I think. |
|
Claude finished @edenreich's task —— View job I've successfully fixed the CI issues! Todo List
Problem & SolutionThe CI was failing because the A2A client interface had been changed to use ADK types directly, but the mocks hadn't been regenerated to match the new interface. The error was: Changes Made
Verification
The mock generation is now complete and matches the refactored A2A client interface. The CI should pass on the next run! |
- Update A2A client mock to use adk.* types instead of a2a.* types - Fix streaming test to use adk.AgentCapabilities instead of a2a.AgentCapabilities - Ensures mocks match the refactored A2A client interface Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
@claude Fix the linting issue |
|
Claude finished @edenreich's task —— View job Claude finished @edenreich's task Todo List
Problem Identified & FixedThe CI was failing on linting due to extra blank lines in Changes made:
Verification: ✅ Linting now passes with 0 issues Commit: The linting issue has been resolved and the changes are committed to the PR branch. The CI should now pass! |
Remove extra blank lines between functions to comply with gofmt requirements Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
@claude Please fix the tests, adjust them since we're now using the ADK. |
|
Claude finished @edenreich's task —— View job Todo List
Problem & SolutionThe tests were failing because the A2A client interface was refactored to use ADK types directly, but the tests still expected old custom A2A types. The main issues were:
Changes MadeUpdated A2A middleware tests (
Verification
Commit
The tests are now fully compatible with the ADK client refactoring and the CI should pass! |
- Update test imports to include ADK package - Replace all A2A types with ADK types in test structures - Update AgentSkill, AgentCard, AgentCapabilities to use ADK types - Update Task, TaskStatus, TaskState, Message, and Part to use ADK types - Update SendMessageSuccessResponse and GetTaskSuccessResponse to use ADK types - Remove unused A2A import This fixes the test failures that occurred after refactoring the A2A client to use ADK types directly instead of custom wrapper types. Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
…essage methods Signed-off-by: Eden Reich <eden.reich@gmail.com>
…prove weather tool functionality - use the ADK server - Updated go.mod and go.sum to use newer versions of dependencies, including inference-gateway/a2a and go-envconfig. - Refactored main.go to load configuration from environment variables and initialize the A2A server with a weather tool. - Removed the weather.go file and integrated weather data generation directly into main.go. - Enhanced the weather tool to provide mock weather data based on location and units. - Added graceful shutdown handling for the A2A server. Signed-off-by: Eden Reich <eden.reich@gmail.com>
|
WIP need to troubleshoot why the agents doesn't work as intended, I might need to improve the docs on the a2a repository and check the examples on that repository further before proceeding here. |
…handling Signed-off-by: Eden Reich <eden.reich@gmail.com>
Since now the Inference Gateway check the health check of the agents - it's no longer needed. Also remove the order dependency, the system is now working in eventual consistency method. Signed-off-by: Eden Reich <eden.reich@gmail.com>
…s in docker-compose Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
…agents Signed-off-by: Eden Reich <eden.reich@gmail.com>
…tant messages Get the final assistant message as the response from the Task. Signed-off-by: Eden Reich <eden.reich@gmail.com>
…ve unused agent metadata WIP - I need to check why the new release of the google-calendar-agent still spamming with health check logs by default. Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
…convention Signed-off-by: Eden Reich <eden.reich@gmail.com>
…, hello world, and weather agents Signed-off-by: Eden Reich <eden.reich@gmail.com>
…tool functions Signed-off-by: Eden Reich <eden.reich@gmail.com>
|
@claude /review |
|
Claude finished @edenreich's task —— View job Claude Code PR Review Todo List
Review SummaryThis refactoring successfully simplifies the A2A client implementation by eliminating custom wrapper types in favor of direct ADK integration. The changes reduce code complexity significantly while maintaining functionality. Overall, this is a well-executed refactoring with good attention to testing and compatibility. ✅ StrengthsCode Quality & Architecture
Test Coverage
Configuration Enhancement
|
… debug logging Signed-off-by: Eden Reich <eden.reich@gmail.com>
…epseek provider and remove unused environment variables Signed-off-by: Eden Reich <eden.reich@gmail.com>
… weather agents feat(a2a): Add configuration file for A2A server and integrate a2a-debugger service in docker-compose Signed-off-by: Eden Reich <eden.reich@gmail.com>
|
@claude /review |
|
Claude finished @edenreich's task —— View job Claude Code PR Review Todo List
Review SummaryThis refactoring successfully simplifies the A2A client implementation by eliminating custom wrapper types in favor of direct ADK integration. The changes reduce code complexity significantly while maintaining functionality. Overall, this is a well-executed refactoring with good attention to testing and compatibility. ✅ StrengthsCode Quality & Architecture
Test Coverage
Configuration Enhancement
|
## [0.13.0](v0.12.0...v0.13.0) (2025-07-25) ### ✨ Features * **a2a:** Implement retry mechanism for agent connections ([#140](#140)) ([54033e8](54033e8)), closes [#139](#139) * Implement A2A agent status polling with background health checks ([#136](#136)) ([1b49a06](1b49a06)), closes [#135](#135) ### ♻️ Improvements * **codegen:** Refactor code generation to automate provider onboarding ([#144](#144)) ([3a97396](3a97396)) * Replace custom A2A code with ADK client implementation ([#138](#138)) ([34d8cf6](34d8cf6)) ### 👷 CI * Add Claude GitHub Actions workflows ([#134](#134)) ([a6a1f8f](a6a1f8f)) * Add MCP configuration for context7 in Claude workflows ([4ce0139](4ce0139)) * **fix:** Add allowed tools configuration for Bash tasks in Claude workflow ([ccf76c8](ccf76c8)) * **fix:** Add base branch and branch prefix configuration with custom instructions for workflow ([8d3a56e](8d3a56e)) * **fix:** Add installation steps for golangci-lint and task in Claude workflow ([e2a718f](e2a718f)) * **fix:** Reduce amounts of claude runs and costs - update workflow trigger to respond to issue comments for code review ([189313b](189313b)) * **fix:** Update Claude workflow conditions to exclude review commands from triggering ([5e3d75d](5e3d75d)) * Update Claude workflows to require write permissions for contents, pull requests, and issues ([ba6477e](ba6477e)) ### 📚 Documentation * **examples:** Update kubernetes examples to use the inference gateway operator ([#131](#131)) ([3ab617a](3ab617a))
|
🎉 This PR is included in version 0.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This PR refactors the A2A client implementation to use the ADK client directly instead of custom wrapper code.
Changes Made:
This refactoring significantly reduces code complexity while maintaining the same functionality.
Closes #137
Generated with Claude Code