-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Python: add option to disable return-to-previous in handoff #3429
Copy link
Copy link
Open
Labels
orchestrationUsage: [Issues, PRs], Target: multi-agent orchestration (high-level patterns)Usage: [Issues, PRs], Target: multi-agent orchestration (high-level patterns)pythonUsage: [Issues, PRs], Target: PythonUsage: [Issues, PRs], Target: PythonquestionUsage: [Issues, PRs], Target: all issues or PRs where additional context is needed from the authorUsage: [Issues, PRs], Target: all issues or PRs where additional context is needed from the authorworkflowsUsage: [Issues, PRs], Target: WorkflowsUsage: [Issues, PRs], Target: Workflows
Description
Activity
Metadata
Metadata
Labels
orchestrationUsage: [Issues, PRs], Target: multi-agent orchestration (high-level patterns)Usage: [Issues, PRs], Target: multi-agent orchestration (high-level patterns)pythonUsage: [Issues, PRs], Target: PythonUsage: [Issues, PRs], Target: PythonquestionUsage: [Issues, PRs], Target: all issues or PRs where additional context is needed from the authorUsage: [Issues, PRs], Target: all issues or PRs where additional context is needed from the authorworkflowsUsage: [Issues, PRs], Target: WorkflowsUsage: [Issues, PRs], Target: Workflows
Type
Projects
- StatusShow more project fieldsNo status
Description
After the handoff refactor in PR #3023, the Python handoff workflow became fully decentralized and user replies always return to the last active agent. The previous API
HandoffBuilder.enable_return_to_previous(...)(introduced in #2037) was removed, so there is no way to opt out of “return to previous agent”.This is a regression for workflows that rely on a coordinator re-evaluating after each user response (e.g., specialist gathers info, then coordinator decides next steps). Using group chat changes other semantics and does not always fit the handoff model.
Expected behavior
Provide a configuration option to disable return-to-previous and route user responses back to a designated coordinator (or the start agent), similar to the prior
enable_return_to_previous(False)behavior. An API-level option onHandoffBuilder(or equivalent) would be ideal.Alternatives considered
References
enable_return_to_previousexisted pre-[BREAKING] Python: Refactor orchestrations #3023 inpython/packages/core/agent_framework/_workflows/_handoff.py.