Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add SyncStreamingProvider with Tracing Support
Context & Motivation
Why Not Use
run_agent_streamed_auto_send?For sync agents (FastACP),
run_agent_streamed_auto_senddoesn't work correctly because:Redis streaming incompatibility: Sync agents yield
TaskMessageUpdatechunks directly to the frontend via async generators.They don't subscribe to Redis server-side events like temporal agents do.
Duplicate messages:
run_agent_streamed_auto_sendstreams to Redis AND saves messages to the database. For sync agents, thiscauses:
Wrong abstraction: The
auto_sendmethods were designed for temporal workflows, not for sync agents that directly yield tothe frontend.
The Solution
This PR provides
SyncStreamingProviderwhich:Runner.run_streameddirectly (the correct way for sync agents)TaskMessageUpdateevents in real-timeCore Concepts
SyncStreamingProvider
A provider wrapper that:
run_agent(non-streaming) andrun_agent_streamed(streaming)adk.tracingsystemconvert_openai_to_agentex_events()
A helper function that converts OpenAI streaming events to AgentEx
TaskMessageUpdateevents, enabling compatibility with theFastACP streaming protocol.
Usage
Basic Setup with Streaming