Skip to content

Allow SingleAgentVoiceWorkflow to receive Runner context #4635

Closed

Description

@sylvesterkaczmarek

Please read this first

  • Have you read the docs? Yes.
  • Have you searched for related issues and PRs? Yes.

Related: #819 documented this limitation and was later closed after the reporter worked around it by creating a custom VoiceWorkflowBase implementation. I could not find an existing PR that adds context support to SingleAgentVoiceWorkflow itself.

Describe the feature

SingleAgentVoiceWorkflow is the convenience path for a single-agent voice workflow, but its internal call is currently fixed to:

Runner.run_streamed(self._current_agent, self._input_history)

That means an agent that relies on normal Runner context cannot use the convenience workflow directly. Context-dependent instructions, tools, handoffs, and is_enabled predicates require users to copy the workflow implementation into a custom subclass just to pass context=....

A narrow API addition would be to accept an optional keyword-only context when constructing SingleAgentVoiceWorkflow and forward that same context to each internal Runner.run_streamed() call.

For example:

context = UserContext(user_id="user-123")
workflow = SingleAgentVoiceWorkflow(agent, context=context)
pipeline = VoicePipeline(workflow=workflow)

Desired semantics

  1. Existing SingleAgentVoiceWorkflow(agent) and SingleAgentVoiceWorkflow(agent, callbacks) calls remain unchanged.
  2. context= is optional and keyword-only.
  3. The supplied context is forwarded to every streamed Runner turn, including later turns after the workflow updates its input history/current agent.
  4. Context behavior remains the normal Runner behavior; the voice layer does not introduce a separate context wrapper or lifecycle.
  5. Custom VoiceWorkflowBase implementations remain the supported path for broader per-turn Runner customization.

Non-goals

  • no change to VoicePipeline.run() arguments;
  • no new voice-specific context abstraction;
  • no automatic copying or serialization of application context;
  • no broader RunConfig, session, or conversation-state API in this change.

This keeps the convenience workflow useful for context-dependent agents without expanding the voice pipeline contract.

Activity

  1. changed the title [-][Voice] Allow SingleAgentVoiceWorkflow to receive Runner context[/-] [+]Allow SingleAgentVoiceWorkflow to receive Runner context[/+] on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions