Repository navigation
Python: add option to disable return-to-previous handoff routing - #8639
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The test must verify that the reactivated start agent receives the user response before running.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds an opt-out from return-to-previous handoff routing, allowing the start agent to reconsider user responses.
Changes:
- Adds
enable_return_to_previous(). - Routes responses through the start agent when disabled.
- Adds documentation and routing tests.
| File | Description |
|---|---|
_handoff.py |
Implements configurable response routing. |
test_handoff.py |
Tests default and configured routing. |
README.md |
Documents the new option. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): 6fecf1731ba3
Model: gpt-5.6-sol-fast
Overview
This PR preserves return-to-previous routing by default and adds an opt-out path that broadcasts the resumed user message before activating the configured start agent. The fully connected workflow topology, per-edge message ordering, start-agent validation, and focused routing tests guard the intended behavior. No Critical, High, or Medium defect remains after reconciliation.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

Motivation & Context
The handoff refactor made user replies always return to the agent that requested them. Workflows that use the start
agent to re-evaluate each user turn no longer have a way to opt out of that routing behavior.
This restores a configuration option while preserving the current default.
Description & Review Guide
HandoffBuilder.enable_return_to_previous(enabled=True), routes replies throughthe configured start agent when disabled, and adds focused tests and documentation.
Falsetohave the start agent reconsider each subsequent user response before handing off again.
activating the start agent only for the opt-out path.
Related Issue
Closes #3429
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.