Skip to content

[FEATURE] Steering Support for Bidirectional (BiDi) Agents #1458

@dbschmigelski

Description

@dbschmigelski

Problem Statement

The current steering system (steer_before_tool() and steer_after_model()) was designed for unidirectional agent execution flows. With the introduction of bidirectional streaming agents (Python 3.12+), there is no clear path for how steering handlers should intercept and guide agent behavior in a bidirectional context.

As noted in PR #1429, "steering on bidi agents is currently uncertain" and this needs to be resolved before the steering feature can exit experimental status. The existing implementation focuses exclusively on unidirectional agents, leaving bidirectional support as undefined future work requiring architectural decisions.

Proposed Solution

Design and implement steering support for bidirectional agents that addresses:

  1. Event Interception Points: Define where in the bidirectional streaming flow steering handlers can intercept events (e.g., during streaming chunks, at message boundaries, or at turn completion)

  2. Action Semantics: Clarify how Proceed, Guide, and Interrupt actions behave in a streaming context:

    • Can a Guide action be issued mid-stream to redirect the model?
    • How does Interrupt interact with an active bidirectional stream?
    • Should there be new action types specific to streaming scenarios?
  3. Handler Interface: Extend or adapt the SteeringHandler protocol for bidi agents:

    async def steer_bidi_stream(
        self, agent: Agent, stream_event: StreamEvent, **kwargs
    ) -> BiDiSteeringAction

Proposed Solution

No response

Use Case

Steer bidi agents in the same manner as uni agents

Alternatives Solutions

No response

Additional Context

No response

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