Skip to content

refactor(server): Remove handler duplication between A2AServerImpl and DefaultA2AProtocolHandler#101

Merged
edenreich merged 2 commits intomainfrom
claude/issue-100-20251011-1512
Oct 11, 2025
Merged

refactor(server): Remove handler duplication between A2AServerImpl and DefaultA2AProtocolHandler#101
edenreich merged 2 commits intomainfrom
claude/issue-100-20251011-1512

Conversation

@edenreich
Copy link
Copy Markdown
Contributor

Fixes #100

Problem

There was unnecessary duplication and dead code in task handler management between A2AServerImpl and DefaultA2AProtocolHandler, creating maintenance burden and synchronization issues.

Solution

Implemented the recommended method parameter injection approach:

  • Removed unused backgroundTaskHandler field from DefaultA2AProtocolHandler
  • Eliminated streamingTaskHandler duplication using method parameter injection
  • Updated A2AProtocolHandler interface to accept StreamableTaskHandler as parameter
  • Ensured single source of truth for task handlers (server only)
  • Fixed synchronization issues with SetStreamingTaskHandler()
  • Updated tests and regenerated mocks to match new interface

Benefits

  • 🗑️ Eliminated dead code
  • 🎯 Single source of truth for handlers
  • 🔄 Fixed synchronization issues
  • 🏗️ Cleaner architecture with dependency injection
  • ✅ Improved testability

Testing

  • All linting checks pass (task lint)
  • All tests continue to pass (task test)
  • No breaking changes to public API

Generated with Claude Code

claude bot and others added 2 commits October 11, 2025 15:16
…d DefaultA2AProtocolHandler

- Remove unused `backgroundTaskHandler` field from `DefaultA2AProtocolHandler`
- Eliminate `streamingTaskHandler` duplication using method parameter injection
- Update A2AProtocolHandler interface to accept StreamableTaskHandler as parameter
- Ensure single source of truth for task handlers (server only)
- Fix synchronization issues with `SetStreamingTaskHandler()`
- Update tests and regenerate mocks to match new interface
- All linting checks pass and tests continue to work

Resolves issues identified in task handler management:
- Dead code removal
- Architectural cleanup
- Improved dependency injection
- Better testability

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
@edenreich edenreich merged commit 75b9c20 into main Oct 11, 2025
1 check passed
@edenreich edenreich deleted the claude/issue-100-20251011-1512 branch October 11, 2025 16:35
ig-semantic-release-bot bot added a commit that referenced this pull request Oct 11, 2025
## [0.14.0](v0.13.1...v0.14.0) (2025-10-11)

### ✨ Features

* Add the callbacks ready to be used by the agent ([#94](#94)) ([84632f3](84632f3))
* **types:** Refactor Part deserialization to use concrete types ([#104](#104)) ([22d192e](22d192e)), closes [#102](#102)

### ♻️ Improvements

* Consolidate the logic of the agent and remove redundancy ([#93](#93)) ([54e5e71](54e5e71))
* **docker-compose:** Remove port mappings for server service to avoid confusion ([3df7b08](3df7b08))
* **server:** Remove handler duplication between A2AServerImpl and DefaultA2AProtocolHandler ([#101](#101)) ([75b9c20](75b9c20))

### 🐛 Bug Fixes

* Improve validation logic for task handler configuration ([#98](#98)) ([34d6354](34d6354))

### 👷 CI

* Add Prettier setup and formatting steps for Go and markdown files ([#105](#105)) ([f2a1994](f2a1994))

### 📚 Documentation

* **examples:** Add input-required flow examples ([#96](#96)) ([17764f3](17764f3))

### 🔧 Miscellaneous

* **deps:** Update claude-code to 2.0.8 and install gh cli version 2.81.0 in flox environment ([4d6e41a](4d6e41a))
@ig-semantic-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Remove handler duplication between A2AServerImpl and DefaultA2AProtocolHandler

1 participant