Skip to content

feat: AG-UI native support#2315

Merged
marklysze merged 17 commits intomainfrom
refactor/streaming-a2a
Feb 3, 2026
Merged

feat: AG-UI native support#2315
marklysze merged 17 commits intomainfrom
refactor/streaming-a2a

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
Copy link
Contributor

joggrbot bot commented Jan 6, 2026

📝 Documentation Analysis

All docs are up to date! 🎉


✅ Latest commit analyzed: 51089ae | Powered by Joggr

@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

@Lancetnik Lancetnik marked this pull request as ready for review February 2, 2026 22:54
@Lancetnik Lancetnik changed the title feat: A2A streaming execution feat: AG-UI native support Feb 2, 2026
@marklysze
Copy link
Collaborator

Thanks @Lancetnik! I replicated some of the examples from AG-UI's Interactive Dojo and they worked successfully with AG2. Tweaked some of the documentation as well.

@marklysze marklysze added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit 865827b Feb 3, 2026
29 checks passed
@marklysze marklysze deleted the refactor/streaming-a2a branch February 3, 2026 03:17
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 83.22981% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
autogen/a2a/client.py 40.00% 6 Missing ⚠️
autogen/ag_ui/adapter.py 89.47% 5 Missing and 1 partial ⚠️
autogen/a2a/client_factory.py 80.95% 2 Missing and 2 partials ⚠️
autogen/agentchat/remote/agent_service.py 71.42% 4 Missing ⚠️
autogen/a2a/__init__.py 60.00% 2 Missing ⚠️
autogen/a2a/utils.py 83.33% 1 Missing and 1 partial ⚠️
autogen/ag_ui/asgi.py 84.61% 2 Missing ⚠️
autogen/a2a/agent_executor.py 90.90% 0 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (d4035bb) and HEAD (51089ae). Click for more details.

HEAD has 949 uploads less than BASE
Flag BASE (d4035bb) HEAD (51089ae)
3.10 88 9
docs 12 0
windows-latest 102 0
optional-deps 12 0
3.13 75 0
core-without-llm 24 1
ubuntu-latest 104 10
3.11 88 1
3.12 62 0
macos-latest 107 0
gpt-assistant-agent 6 0
teachable 6 0
long-context 6 0
lmm 6 0
websurfer 23 0
agent-eval 2 0
retrievechat 12 0
retrievechat-qdrant 12 0
gemini 19 1
llama-index-agent 6 0
cohere 23 0
retrievechat-couchbase 4 0
retrievechat-mongodb 4 0
retrievechat-pgvector 4 0
groq 21 0
together 22 0
bedrock 17 1
ollama 22 1
mistral 23 0
cerebras 21 1
swarm 22 0
anthropic 20 1
Files with missing lines Coverage Δ
autogen/a2a/errors.py 100.00% <100.00%> (ø)
autogen/ag_ui/__init__.py 100.00% <100.00%> (ø)
autogen/agentchat/remote/__init__.py 100.00% <100.00%> (ø)
autogen/agentchat/remote/errors.py 66.66% <ø> (ø)
autogen/agentchat/remote/protocol.py 100.00% <100.00%> (ø)
autogen/agentchat/remote/retry.py 46.15% <ø> (ø)
autogen/version.py 100.00% <100.00%> (ø)
autogen/a2a/agent_executor.py 87.17% <90.90%> (+0.33%) ⬆️
autogen/a2a/__init__.py 86.66% <60.00%> (+3.33%) ⬆️
autogen/a2a/utils.py 90.21% <83.33%> (-0.11%) ⬇️
... and 5 more

... and 110 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.

priyansh4320 added a commit that referenced this pull request Feb 4, 2026
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