Skip to content

Implement bidirectional handoff system (#1376) #1410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CodeVoyager007
Copy link

Resolves #1376: Bidirectional Handoff System

This PR implements a bidirectional handoff system for orchestrator-style workflows, allowing sub-agents to return control to their parent agent. Key features:

  • AgentRegistry and AgentRunner for scalable agent/workflow management
  • return_to_parent_handoff and create_bidirectional_handoff_workflow for flexible workflows
  • Parallel task execution via run_parallel
  • Convenience functions (create_financial_workflow_registry, create_support_workflow_registry)
  • Comprehensive test suites in tests/test_bidirectional_handoffs.py and tests/test_registry_handoffs.py
  • Documentation in docs/bidirectional_handoffs.md, with updates to docs/index.md, and README.md

Testing

  • All tests pass (pytest tests/test_bidirectional_handoffs.py tests/test_registry_handoffs.py -v)
  • Covers edge cases (missing agents, circular references, parallel execution)

Checklist

  • Code follows SDK conventions
  • Tests cover all new functionality
  • Documentation updated
  • Backward compatible with existing handoffs

Please review and let me know if any changes are needed

@CodeVoyager007 CodeVoyager007 marked this pull request as draft August 8, 2025 14:09
@CodeVoyager007 CodeVoyager007 marked this pull request as ready for review August 9, 2025 15:01
@CodeVoyager007 CodeVoyager007 marked this pull request as draft August 9, 2025 15:01
@seratch seratch added the enhancement New feature or request label Aug 11, 2025
@seratch
Copy link
Member

seratch commented Aug 11, 2025

Thanks for sending this. We're not planning to add this mechanism in the short term, but sharing your work with communities and knowing what people think would be beneficial for us too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Return results to the parent Agent
2 participants