fix: preserve provider tool call metadata in OpenAI chat completions - #121
Merged
Conversation
andreitava-uip
requested review from
DragosBobolea,
cosminacho,
cristipufu,
dragosvelcea,
ionmincu,
ionut-mihalache-uipath,
radu-mocanu and
vldcmp-uipath
as code owners
August 6, 2026 10:46
andreitava-uip
temporarily deployed
to
LLMGW_SETTINGS
August 6, 2026 10:46 — with
GitHub Actions
Inactive
andreitava-uip
temporarily deployed
to
LLMGW_SETTINGS
August 6, 2026 10:53 — with
GitHub Actions
Inactive
ionut-mihalache-uipath
previously approved these changes
Aug 6, 2026
andreitava-uip
force-pushed
the
fix/openai-tool-call-metadata
branch
from
August 6, 2026 14:52
686dc22 to
fd30320
Compare
ionut-mihalache-uipath
approved these changes
Aug 6, 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.
Why
BYOM models exposed through an OpenAI V1-compatible Chat Completions API may return provider-specific tool-call metadata that must be included in subsequent requests. The client currently loses these fields when converting responses into LangChain messages, causing multi-turn tool execution to fail for providers that require the original metadata.
Summary
Testing
uv run pytest tests/langchain/clients/openai/test_tool_call_extras.py -quv run ruff checkuv run ruff format --checkuv run pyright .