Repository navigation
fix(model): return tool-call objects from the Responses API path - #495
Open
ni (nniiovoo) wants to merge 1 commit into
Open
ni (nniiovoo) wants to merge 1 commit into
ni (nniiovoo) wants to merge 1 commit into
Conversation
openai_chat targets on the Responses API returned tool calls as plain dicts, so OfficeQA's tool loop failed with "'dict' object has no attribute 'model_dump'". Build the message with the existing compat_message_from_responses_output instead. Fixes microsoft#494 Signed-off-by: NNIIOVO <haimingni44@gmail.com>
This branch has not been deployed
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.
Fixes #494
For
openai_chattargets on the Responses API (gpt-5.4-pro,*-codex,codex-mini), tool calls came back as plain dicts. OfficeQA's tool loop usestool_call.function.name,tool_call.idandtool_call.model_dump(), so any item that called a tool failed with'dict' object has no attribute 'model_dump'._responses_to_chat_messagenow builds the message with the existingcompat_message_from_responses_output, so tool calls look like Chat Completions ones. Content still comes fromresp.output_text. SpreadsheetBench's ReAct agent gets the same dict shape as before, throughmodel_dump().Tests: new
tests/test_officeqa_responses_tool_calls.py.process_onerun on a fake Responses client (one tool call, then the answer) must finish with the right answer, and must send the call and its output back in Responses form. It fails on main with themodel_dumperror.I tested with a fake client and a local fake endpoint. I haven't run it against a live Responses deployment. The follow-up request also still leaves out the model's reasoning items, as before; I didn't change that here.
Full suite on macOS: 2633 passed. The 2 failures in
tests/test_sleep_adopt_skill_subset.pyalso fail on main.