Python: Preserve approval decisions under OpenAI continuation - #7407
Open
eavanvalkenburg wants to merge 1 commit into
Open
Python: Preserve approval decisions under OpenAI continuation#7407eavanvalkenburg wants to merge 1 commit into
eavanvalkenburg wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1ee1d250-d1e2-4c6f-8c36-aae0d94fe7a1
eavanvalkenburg
temporarily deployed
to
github-app-auth
July 29, 2026 20:11 — with
GitHub Actions
Inactive
eavanvalkenburg
temporarily deployed
to
github-app-auth
July 29, 2026 20:11 — with
GitHub Actions
Inactive
eavanvalkenburg
marked this pull request as ready for review
July 29, 2026 20:12
eavanvalkenburg
temporarily deployed
to
github-app-auth
July 29, 2026 20:12 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes OpenAI Responses API continuation under service-side storage by ensuring the user’s tool-approval decision is not dropped during serialization, so approval-paused runs can reliably resume with previous_response_id / conversation_id.
Changes:
- Update the OpenAI chat client serializer to skip only stored
function_approval_requestitems under service-side storage, while still serializingfunction_approval_responseasmcp_approval_response. - Expand unit test coverage to validate both approved and rejected decisions under storage-on vs storage-off behavior.
- Document the request/response storage boundary and update the function-calling loop spec to reflect the covered scenario.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/packages/openai/agent_framework_openai/_chat_client.py | Stops stripping function_approval_response under service-side storage, preserving approval decisions for continuation. |
| python/packages/openai/tests/openai/test_openai_chat_client.py | Adds parameterized test coverage ensuring approval responses are kept (approved/rejected) while requests are omitted under storage. |
| python/packages/openai/AGENTS.md | Documents how approval request vs response behave under service-side continuation and warns about manual history replay. |
| docs/specs/004-python-function-calling-loop.md | Updates required invariants/coverage lists to include service-side approval decision behavior and its regression test. |
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
TaoChenOSU
reviewed
Jul 29, 2026
|
|
||
| All clients follow the Raw + Full-Featured pattern (e.g., `RawOpenAIChatClient` + `OpenAIChatClient`). | ||
|
|
||
| For Responses API continuation with service-side storage, a prior `function_approval_request` is server-issued and |
Contributor
There was a problem hiding this comment.
nit: this is a bit confusing since OpenAI never issues function approval requests. It only has one approval request type for mcp.
TaoChenOSU
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
OpenAI service-side continuation already stores the approval request, but the current serializer drops the new
approval response as well. The service therefore never receives the user's approved or rejected decision.
Description & Review Guide
function_approval_request.function_approval_responseasmcp_approval_response.previous_response_idor conversation continuation.Related Issue
Fixes #7125
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.