Skip to content

Python: Make response-to-updates examples self-contained - #9437

Open
BlueRaddish wants to merge 1 commit into
microsoft:mainfrom
BlueRaddish:fix/oct13-evening-ms
Open

BlueRaddish wants to merge 1 commit into
microsoft:mainfrom
BlueRaddish:fix/oct13-evening-ms

Conversation

@BlueRaddish

Copy link
Copy Markdown
Contributor

Motivation & Context

Copying either the ChatResponse.to_updates() or AgentResponse.to_updates() example into a clean interpreter uses an undefined updates variable. Each example should demonstrate its response-to-stream round trip without requiring values from a different example.

Description & Review Guide

  • What are the major changes? Import Message and construct a text response in each example before the existing round-trip assertion.
  • What is the impact of these changes? Documentation only; the implementation and public APIs are unchanged.
  • What do you want reviewers to focus on? Whether each short example is self-contained and still demonstrates to_updates()/from_updates() correctly.

Validation on a standard Ubuntu 24.04 runner with uv 0.12.23:

  • Executed each actual method docstring against the unchanged base: both fail with NameError because updates is undefined. Normal public response round trips pass on the same base.
  • Executed both corrected snippets through the public exports: both round trips pass.
  • uv run --frozen --no-sync pytest packages/core/tests/core/test_types.py -m "not integration" -q: 436 passed, no failures or skips.
  • The normal scoped prek hooks pass, and an ordinary Git commit invokes the installed pre-commit hook successfully. The full patch, source/configuration, and tracked dependency lock remain unchanged through validation.

No integration/model/service tests or local SDK tests were executed for this scope.

Related Issue

N/A - trivial change. This replaces the same undefined variable in the two examples with complete text responses and changes no runtime behavior.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Codex assisted with diagnosis, the documentation correction, verification recipes, and this description.

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 links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change.

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.

@BlueRaddish
BlueRaddish deployed to github-app-auth October 16, 2026 01:32 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 16, 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)): 324f2942a572
Model: gpt-5.6-sol

Overview

This documentation-only change makes both response-to-update examples self-contained by constructing a response from a public Message before round-tripping it. The package exports, constructor contract, conversion implementation, existing round-trip tests, and direct execution of both snippets support the examples as written. No Critical, High, or Medium residual 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.

This branch was successfully deployed

1 active deployment
github-app-auth — 324f2942 Deployed Oct 16, 2026 by BlueRaddish via team_check #6917
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants