Skip to content

feat: supervise multi-leg chat transfers - #250

Draft
polyai-moaed wants to merge 1 commit into
polyai:mainfrom
polyai-moaed:moaed/ad-chat-multileg
Draft

feat: supervise multi-leg chat transfers#250
polyai-moaed wants to merge 1 commit into
polyai:mainfrom
polyai-moaed:moaed/ad-chat-multileg

Conversation

@polyai-moaed

Copy link
Copy Markdown
Contributor

Summary

Add an opt-in poly chat --multi-leg mode that supervises the full parent/child/bridge call graph instead of treating warm transfer as one disposable chat session.

Motivation

The existing debug chat ends when a single leg ends. Real warm transfer can create nested, sequential, and concurrent child legs, so developers could not reproduce or inspect the complete lifecycle locally without calls dropping prematurely.

Platform dependency: https://github.com/PolyAI-LDN/poly_core/pull/44534

Changes

  • Add a reusable MultiLegChatSupervisor with independent leg lifecycle tracking
  • Route dial status, parent/child messages, bridge state, failures, and hangups to the affected leg
  • Prefer matching sibling child projects and feature branches for draft projects
  • Add interactive leg inspection/control commands and JSON session output
  • Document --multi-leg and its command set
  • Preserve the existing single-leg chat path by making the feature opt-in

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly chat --help)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Validation:

  • Full suite: 960 passed, 21 warnings, 30 subtests
  • Focused integration suite: 192 passed
  • Ruff check and format check passed
  • git diff --check passed

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes
  • No breaking changes to the poly CLI interface (feature is opt-in)
  • Commit messages follow conventional commits

Screenshots / Logs

N/A — CLI/API behavior is covered by automated tests.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
72.4% 72.5% +0.0% ✅

Changed file coverage

File Coverage Change
poly/cli_commands/chat.py 60.0% -0.6% ⚠️
poly/handlers/platform_api.py 62.4% +3.5% ✅
poly/handlers/interface.py 62.7% +0.0% ✅
poly/project.py 68.1% +1.3% ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant