Python: [BREAKING] Simplify Python hosting core - #6492
Conversation
Remove linking, multicast, durable delivery, and host push machinery from the v1 hosting core. Keep those scenarios in a proposed follow-up ADR and update channel packages, samples, docs, tests, and workspace metadata around the smaller host/channel contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Automated Code Review
Reviewers: 3 | Confidence: 90%
✓ Correctness
The PR simplifies the hosting contract by removing identity linking, multicast, and durable delivery. The refactoring is largely mechanical and correct. One potential double-send regression exists in the Telegram streaming path where introducing
final.textas the primary source offinal_textcan cause both a placeholder edit AND a fallback_reply_with_resultcall when no text was streamed but the final response contains text. The simplification is well-executed. One minor typo was introduced in an error message string in_persistence.pywhere a closing single-quote is missing from the pip install command shown to users.
✓ Security Reliability
Security controls (inbound auth validation, service URL allowlisting, Foundry isolation middleware gating) remain intact. The main issue found is a stale docstring that claims run_hook is still applied to command invocations when it no longer is — a misleading comment rather than a security vulnerability. The changes are well-structured and reduce attack surface. One minor bug: a typo in an error message produces an invalid shell command for users neding to install the disk extra. The Foundry isolation middleware gating to Foundry-hosted environments is intentional per the PR rationale and sound — the middleware was effectively a no-op outside Foundry anyway.
✓ Failure Modes
The structural changes are consistent — all code that produced and consumed the removed state (identities, active channel, runner) is removed together. One minor cosmetic issue: an unbalanced quote in a user-facing pip install error message.
Suggestions
- Fix the unbalanced single-quote in the pip install instruction inside the ImportError message in _persistence.py:35.
Automated review by eavanvalkenburg's agents
36ce095
into
microsoft:feature/python-hosting
Remove linking, multicast, durable delivery, and host push machinery from the v1 hosting core. Keep those scenarios in a proposed follow-up ADR and update channel packages, samples, docs, tests, and workspace metadata around the smaller host/channel contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Motivation and Context
The Python hosting core accumulated identity linking, multicast delivery, push codecs, durable runners, and continuation concepts in the v1 contract. Those concerns make the base host harder to review, secure, and stabilize.
This change narrows v1 to the actual hosting problem: one host, one target, contributed channel routes/lifecycle, explicit session resolution by
ChannelSession.isolation_key, and originating-channel responses.Description
ResponseTarget, host-level push, durable task runner machinery, and related tests fromagent-framework-hosting.ChannelContext.run(...)andChannelContext.run_stream(...), including the renamedChannelStreamUpdateHook.agent-framework-hosting-entraand the local identity-link sample from this v1 pass.Contribution Checklist