Repository navigation
[BREAKING] Python: Consolidate content identity and protocol metadata - #8886
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The ADR omits hosted approval-response identity and a security-relevant legacy server-name fallback.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds ADR 0044 defining Python content identity, hosted-call metadata, namespaced protocol metadata, and compatibility rules.
Changes:
- Defines
Content.id,call_id, and provider identifier semantics. - Introduces the proposed
hostedfield and metadata migration strategy. - Documents replay and legacy compatibility requirements.
| File | Description |
|---|---|
docs/decisions/0044-python-content-identity-and-protocol-metadata.md |
Adds ADR 0044 and implementation guidance. |
💡 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: Findings reported
Scope: full PR (1 commit(s)): 3860235dd295
Model: gpt-5.6-sol
Overview
The ADR establishes a coherent separation between framework occurrence identity, provider identifiers, hosted execution, and replay metadata, with useful compatibility guardrails through legacy reads, dual-writing, and persisted-history tests. The current source confirms the motivating server_label, fc_id, and raw-representation coupling. Two contract gaps remain: streamed function-call merging is not required to preserve the new hosted marker, and the closed provider-ID exception list omits hosted approval responses that must retain the provider approval ID.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (2 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: docs/decisions/0044-python-content-identity-and-protocol-metadata.md
86f7da9 to
2d50303
Compare
2d50303 to
c27093d
Compare
f15bd80 to
22dc69a
Compare
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 3
Result: Findings reported
Scope: full PR (12 commit(s)): 813905710679, 11034587a49f, 0cb8039fb4ba, c265d6091d9e, cfef864eded4, a36eab8ec291, a43d2b5b4cb9, f721cea2de7e, dd83ee663527, 639154615d69, 22dc69aa05f3, 631a6a51fd7b
Model: gpt-5.6-sol
Overview
The PR establishes explicit identity, hosted-routing, metadata, and stream-merge contracts, with strong fail-closed approval handling and focused compatibility tests. Hosted ownership remains fail-safe, finalization clears update-only state, and prior text-snapshot and usage regressions are covered. Residual risk remains in heterogeneous A2A snapshots, authoritative function-call names, and hosted projections that cannot faithfully emit divergent replacement text.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
4 verified findings remained after source verification (4 medium) across 3 files. Details are attached to the affected lines below.
Affected areas: python/packages/a2a/agent_framework_a2a/_agent.py, python/packages/core/agent_framework/_types.py, python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py
Jose Alvarez (jpalvarezl)
left a comment
There was a problem hiding this comment.
Two remaining identity/ownership edge cases to address before merge.
|
/review |


Motivation & Context
Python providers, protocol adapters, and hosts independently decided where content identity, replay data, hosted execution ownership, and streaming instructions lived. This produced more than 25 ad hoc
additional_propertieskeys, cross-package dependencies on provider-specific metadata, replay paths that depended on non-persisted SDK objects, and stream aggregation that guessed whether payloads were deltas or snapshots.The implicit stream heuristic corrupts repetitive code-interpreter output, while the lack of an explicit local-versus-hosted approval boundary can serialize resolved local approvals as provider-hosted MCP approvals. A shared contract is needed across core and every official provider rather than another provider-specific workaround.
Description & Review Guide
What are the major changes?
Content.hosted,server_name, occurrence-aware function-result identity, and explicitmerge_mode="append" | "replace"semantics. Final response aggregation consumes the update-only merge mode.additional_propertiesnamespaces and shared read, copy-on-write, and merge helpers. Agent Framework-owned provider-neutral metadata usescore; provider data uses namespaces such asopenai,foundry,bedrock,mistral, anda2a.hosted=True.raw_representation, preserves legacy reads, and dual-writes independently consumed replay metadata where required.What is the impact of these changes? Provider stream conversion and aggregation now preserve the provider's actual append-versus-replace intent, hosted calls cannot execute locally, local approvals are not projected as MCP approvals, and persisted histories can replay without live SDK objects.
Breaking-change boundary: upgrading is compatible with histories written by existing releases. However, the new runtime serializes
hostedon function-call content and may serializemerge_modeon individual streamed updates. Older Agent Framework runtimes do not recognize these fields and reject those records duringContentdeserialization. Rolling back after new records have been persisted, or running old and new workers against the same session/history store, is therefore unsupported. Final aggregated responses clearmerge_mode, and the new runtime continues to read legacyserver_labeland metadata locations, so this is specifically a backward-reader and mixed-version persistence break rather than a source-level removal of the existing APIs.Release coordination: every Python package changed by this PR must receive a coordinated version bump in the same release, and all inter-package dependency floors must be updated to the corresponding co-released versions. Core, providers, protocol adapters, UI packages, and hosting packages must not be released as a partial subset: newer adapters emit or depend on fields, namespace merging, and replay behavior that older core or sibling packages do not understand.
What do you want reviewers to focus on? The first-class identity and hosted-execution boundary, whether each provider event is correctly classified as incremental or authoritative, the one-level namespace merge/copy rules, and the compatibility scope for replay-critical metadata.
Related Issue
Fixes #8910
Fixes #8903
Fixes #7452
AI Assistance
AI assistance details: Repository inventory, design and specification drafting, implementation across provider adapters, regression tests, documentation editing, and this PR description.
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.