feat: Implement A2A agent status polling with background health checks#136
feat: Implement A2A agent status polling with background health checks#136
Conversation
- Add AgentStatus type with available/unavailable/n/a states
- Implement background polling mechanism using existing A2A config
- Add thread-safe status storage with sync.RWMutex
- Add GetAgentStatus and GetAllAgentStatuses methods to A2AClient
- Add StartStatusPolling and StopStatusPolling lifecycle methods
- Add GET /v1/a2a/agents/status endpoint for all agent statuses
- Add GET /v1/a2a/agents/{id}/status endpoint for specific agent status
- Integrate status polling startup/shutdown with main application lifecycle
- Health checks use agent card fetching with configurable timeouts
- Status changes are logged for monitoring and debugging
Resolves #135
Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
Claude finished @edenreich's task —— View job Code Review Complete ✅Todo List:
Review Feedback✅ Code Quality and Best PracticesStrengths:
Minor Suggestions:
|
|
Claude finished @edenreich's task —— View job Code Review Complete ✅Todo List:
Review Feedback✅ Code Quality and Best PracticesStrengths:
Minor Suggestions:
|
|
@claude /review |
|
Claude encountered an error —— View job Code Review in ProgressTodo List:
|
|
Claude encountered an error —— View job Code Review Complete ✅Todo List:
Review Feedback✅ Code Quality and Best PracticesStrengths:
Minor Suggestions:
|
|
@claude please fix the ci issues - it's failing, did you forget to run task commands? |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
4 similar comments
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
|
@claude can you please use the inference gateway adk client for this task: https://github.com/inference-gateway/a2a ? |
|
Claude encountered an error —— View job Successfully Integrated External A2A Client LibraryTodo List:
Integration Complete: Successfully integrated the external A2A client library ( Key Changes:
Benefits:
Committing changes now... |
- Replace custom HTTP client with external A2A client library (github.com/inference-gateway/a2a@v0.5.0) - Maintain multi-agent support through client wrapper pattern - Add type conversions between internal and external formats - Update health checking to use external client methods - Fix tests to work with new client initialization pattern - Preserve existing interface for backward compatibility Benefits: - Standardized A2A protocol compliance - Better error handling and retry logic - Robust external client with proper health monitoring - Maintained backward compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
|
@claude There are ci issues, can you please fix them? |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
…ure correct versioning Signed-off-by: Eden Reich <eden.reich@gmail.com>
… instead of "n/a" Signed-off-by: Eden Reich <eden.reich@gmail.com>
…rity Signed-off-by: Eden Reich <eden.reich@gmail.com>
…error handling tests Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
|
@claude /review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements A2A (Agent-to-Agent) status polling functionality with background health checks. The feature adds comprehensive status monitoring capabilities for A2A agents, including thread-safe status tracking, new API endpoints for status retrieval, and integration with the application lifecycle.
- Adds AgentStatus type with available/unavailable/unknown states and background polling mechanism
- Implements new API endpoints for retrieving agent statuses (individual and all agents)
- Migrates A2A client to use external client library with improved error handling and health monitoring
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| a2a/client.go | Major refactor to use external A2A client library, adds status tracking with sync.RWMutex, implements background polling |
| api/routes.go | Adds GetAgentStatusHandler and GetAllAgentStatusesHandler endpoints with comprehensive documentation |
| cmd/gateway/main.go | Integrates status polling startup/shutdown with application lifecycle |
| tests/mocks/ | Updates mock interfaces to include new status-related methods |
| tests/a2a_client_test.go | Updates tests to work with new client implementation and error messages |
| config/config_test.go | Updates error message format expectations |
| go.mod | Adds external A2A library dependency and updates other dependencies |
Signed-off-by: Eden Reich <eden.reich@gmail.com>
## [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 📦🚀 |

Resolves #135