Repository navigation
Record custom tool calls from OpenAI chat completions - #2647
Merged
alexmojaki merged 2 commits intoOct 26, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 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.
A chat completions response can call a custom tool: the tool call has
type: "custom"and a free-formcustom.inputstring instead of JSONfunction.arguments.convert_openai_response_to_semconvonly handled function tool calls, so the custom ones were left out ofgen_ai.output.messages. When such a call is replayed in the next request,convert_chat_completions_to_semconvlooked for afunctionkey that is not there and recorded a tool call with an empty name and no arguments.Both conversions now handle custom tool calls: the part gets the call id,
custom.nameas the name andcustom.inputas the arguments.Tests:
test_convert_openai_response_custom_tool_callconverts a message with one function call and one custom call, andtest_convert_chat_completions_custom_tool_call_inputconverts a history with a custom call and its tool response. Both fail onmainand pass here. The rest oftest_openai.pygives the same result asmain.This change was made with Claude Code.
🤖 Generated with Claude Code
🤖 Generated with Claude Code