Skip to content

Conversation

@Lancetnik
Copy link
Member

Summary

This PR consolidates remote service functionality under the a2a namespace and introduces streaming support for agent execution. The changes improve code organization, enable real-time response streaming, and remove deprecated remote service implementations.

Changes

1. Remote Services Consolidation (eb8dff96e6)

  • Removed the deprecated autogen/remote module (856 lines removed)
    • Deleted autogen/remote/agent.py and autogen/remote/runtime.py
    • Removed all associated tests from test/remote/
  • Moved remote service files from autogen/remote/ to autogen/a2a/remote/
    • agent_service.py, errors.py, httpx_client_factory.py, protocol.py, retry.py
  • Updated imports across the codebase to use the new a2a.remote namespace
  • Cleaned up pyproject.toml and .github/CODEOWNERS to reflect the new structure

2. Streaming Service Support (72132ca1be)

  • Refactored AgentService.__call__() to return an AsyncGenerator[ServiceResponse, None] instead of a single response
  • Updated AutogenAgentExecutor.execute() to handle streaming responses:
    • Processes responses incrementally as they're generated
    • Publishes working status updates in real-time
    • Handles input requirements immediately when detected
  • Enhanced protocol with ServiceResponse model supporting:
    • Streaming messages (message field)
    • Context updates (context field)
    • Input requirements (input_required field)
  • Added utility functions in utils.py:
    • make_working_message() - for streaming status updates
    • make_input_required_message() - for human-in-the-loop scenarios
    • make_artifact() - for final artifact creation
  • Expanded test coverage in test/a2a/test_executor.py (175 new lines)
  • Cleaned up test/a2a/test_parsing.py (removed 63 lines of redundant code)

3. AgentService Streaming Execution Refinement (f99fc6362d)

  • Simplified AgentService streaming logic (9 insertions, 15 deletions)
  • Improved code clarity and maintainability in the streaming execution flow

Benefits

  1. Better Code Organization: All A2A-related remote functionality is now consolidated under autogen/a2a/remote/
  2. Real-time Updates: Clients can now receive incremental updates as agents process requests
  3. Improved UX: Streaming enables better user experience with immediate feedback
  4. Reduced Codebase: Removed ~700 lines of deprecated code and tests
  5. Cleaner Architecture: Simplified service interface with async generators

Testing

  • Existing tests updated to work with new streaming interface
  • New comprehensive tests added in test/a2a/test_executor.py
  • All tests passing with the new streaming implementation

Migration Notes

  • Code using autogen.remote should migrate to autogen.a2a.remote
  • AgentService now returns an async generator - consumers should iterate over responses
  • AutogenAgentExecutor automatically handles streaming, no changes needed for executor users

Files Changed

  • 25 files changed: 167 insertions(+), 863 deletions(-)
  • Key files:
    • autogen/a2a/remote/agent_service.py - Streaming implementation
    • autogen/a2a/agent_executor.py - Streaming executor integration
    • autogen/a2a/remote/protocol.py - Enhanced protocol models
    • autogen/a2a/utils.py - New utility functions
    • test/a2a/test_executor.py - Expanded test coverage

@Lancetnik Lancetnik requested a review from marklysze January 6, 2026 15:03
@joggrbot

This comment has been minimized.

@Lancetnik Lancetnik marked this pull request as draft January 6, 2026 15:04
@Lancetnik
Copy link
Member Author

Need to verify changes correctness with real-world samples before merge

@Lancetnik Lancetnik self-assigned this Jan 6, 2026
@Lancetnik
Copy link
Member Author

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
autogen/a2a/remote/agent_service.py 64.28% 5 Missing ⚠️
autogen/a2a/remote/__init__.py 77.77% 2 Missing ⚠️
autogen/a2a/utils.py 83.33% 1 Missing and 1 partial ⚠️
autogen/a2a/agent_executor.py 90.90% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
autogen/a2a/__init__.py 83.33% <100.00%> (ø)
autogen/a2a/client.py 66.07% <100.00%> (-1.39%) ⬇️
autogen/a2a/errors.py 100.00% <100.00%> (ø)
autogen/a2a/httpx_client_factory.py 82.60% <100.00%> (ø)
autogen/a2a/remote/errors.py 66.66% <ø> (ø)
autogen/a2a/remote/httpx_client_factory.py 91.30% <ø> (ø)
autogen/a2a/remote/protocol.py 100.00% <100.00%> (ø)
autogen/a2a/remote/retry.py 46.15% <ø> (ø)
autogen/a2a/agent_executor.py 87.17% <90.90%> (+0.33%) ⬆️
autogen/a2a/remote/__init__.py 77.77% <77.77%> (ø)
... and 2 more

... and 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants