Python: Prefer runtime kwargs for conversation_id in OpenAI Responses client#3312
Merged
giles17 merged 2 commits intomicrosoft:mainfrom Jan 23, 2026
Merged
Python: Prefer runtime kwargs for conversation_id in OpenAI Responses client#3312giles17 merged 2 commits intomicrosoft:mainfrom
kwargs for conversation_id in OpenAI Responses client#3312giles17 merged 2 commits intomicrosoft:mainfrom
Conversation
kwargs for conversation_id in OpenAI Responses clientkwargs for conversation_id in OpenAI Responses client
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in tool-call routing by changing the priority order for conversation_id retrieval. The fix ensures that runtime-updated conversation IDs (passed via kwargs during tool execution loops) take precedence over the initial configuration (stored in options dict).
Changes:
- Modified
_get_current_conversation_idto check kwargs before options, ensuring fresh conversation IDs from tool execution loops are used instead of stale initial values
python/packages/core/agent_framework/openai/_responses_client.py
Outdated
Show resolved
Hide resolved
markwallace-microsoft
approved these changes
Jan 21, 2026
dmytrostruk
approved these changes
Jan 23, 2026
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…nses client (microsoft#3312) * prefer kwargs conversation_id over options * addressed comments
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 and Context
Fixes stale tool-call routing by preferring the freshest
conversation_idpropagated via runtimekwargsResolves #3304
Description
Contribution Checklist