microsoft / microsoft/agent-framework

Python: add option to disable return-to-previous in handoff

Open
#3,429 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

orchestration python question workflows
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

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 on HandoffBuilder (or equivalent) would be ideal.

Alternatives considered

  • Use group chat for centralized routing (changes workflow semantics)
  • Downgrade to a pre-#3023 version (not desirable long-term)

References

  • enable_return_to_previous existed pre-#3023 in python/packages/core/agent_framework/_workflows/_handoff.py.
  • Removed during refactor PR #3023.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.