Skip to content

Python: [BREAKING] Standardize preview connector exception and ownership contracts #9628

Open

Description

Maintainer-owned issue. Community contributors: please do not pick up or start implementing this issue. This issue covers alpha and beta connector/hosting APIs.

Problem

Preview connectors have inconsistent exception translation, cancellation handling, and ownership of injected SDK or HTTP clients. These behaviors should be corrected before release, even where that changes the current preview contract.

Use Case and Evidence

A2A transport negotiation in python/packages/a2a/agent_framework_a2a/_agent.py around lines 407-430 catches broad exceptions and raises RuntimeError; its constructor also coordinates injected and internally created HTTP clients. Similar patterns appear across preview hosting and connector packages.

Desired Outcome

Use domain-owned Agent Framework exceptions for external failures, preserve causes and cancellation, require settings only when creating clients, and close only framework-owned resources.

Alternatives Considered

Preserving current preview behavior would make inconsistent contracts stable. Applying one generic wrapper to every connector would ignore provider-specific recovery boundaries.

Proposed Direction

Audit each preview connector constructor and execution boundary, define ownership flags and close/context-manager behavior, and document intentional breaking changes before package promotion.

Scope and Non-Goals

Released package changes are excluded and tracked as vNext work.

Language

Python

Contribution Intent

Maintainer-owned; implementation must wait for maintainer design agreement.

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.

Ownership: Core maintainers only; not available for community pickup.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeUsage: [PRs], Target: all PRs that introduce changes that are not backward compatiblepythonUsage: [Issues, PRs], Target: Python

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions