Skip to content

Python: Fix the serialization protocol round-trip example - #9106

Open
BlueRaddish wants to merge 2 commits into
microsoft:mainfrom
BlueRaddish:docs/serialization-protocol-examples
Open

BlueRaddish wants to merge 2 commits into
microsoft:mainfrom
BlueRaddish:docs/serialization-protocol-examples

Conversation

@BlueRaddish

@BlueRaddish BlueRaddish commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Motivation & Context

The SerializationProtocol documentation calls UsageDetails.to_dict() and UsageDetails.from_dict(), but UsageDetails is now a TypedDict and creates a plain dictionary. Copying that example raises AttributeError.

Description & Review Guide

  • What are the major changes? Use Content for the serialization/round-trip examples and explicitly import the protocol so the second block runs on its own.
  • What is the impact of these changes? Both examples can be copied and executed; runtime behavior is unchanged.
  • What do you want reviewers to focus on? Confirm that Content illustrates the existing serialization protocol accurately.

Validation: executed both protocol docstring examples directly from the edited source against the editable core package. The original second block failed with 'dict' object has no attribute 'to_dict'; both now pass. Ruff and git diff --check passed. No model calls were needed.

Related Issue

Small documentation correction, following CONTRIBUTING's exception for trivial changes. Fresh upstream code and open-PR searches still showed the broken example and no overlapping correction.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change.

The full build and unit suite were not run for this docstring-only correction. The focused checks above passed. No issue is linked under CONTRIBUTING's exception for trivial corrections.

AI assistance: OpenAI Codex prepared and validated the correction.

Co-authored-by: OpenAI Codex <noreply@openai.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 6, 2026
@eavanvalkenburg

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): 48459506b3f5
Model: gpt-5.6-sol

Overview

This documentation-only change replaces an invalid UsageDetails example with a standalone Content serialization round trip. Content provides the documented constructors and serialization methods, is exported from the package root, and its text round-trip behavior is covered by existing tests. No runtime, compatibility, architectural, or security risk was established.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

@agent-framework-automation

Copy link
Copy Markdown

BlueRaddish, this pull request is waiting on your response. If there is no further activity within 4 days, it will be closed automatically. (This is an automated message.)

@agent-framework-automation agent-framework-automation Bot added the requested-info Information or updates are needed from the author; inactive PRs may be closed automatically. label Nov 4, 2026

This branch was previously deployed

1 inactive deployment
github-app-auth — 10b3dc87 Deployed Oct 13, 2026 by eavanvalkenburg via add_label #25108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python requested-info Information or updates are needed from the author; inactive PRs may be closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants