Skip to content

fix(model): return tool-call objects from the Responses API path - #495

Open
ni (nniiovoo) wants to merge 1 commit into
microsoft:mainfrom
nniiovoo:fix/officeqa-responses-tool-calls
Open

ni (nniiovoo) wants to merge 1 commit into
microsoft:mainfrom
nniiovoo:fix/officeqa-responses-tool-calls

Conversation

@nniiovoo

Copy link
Copy Markdown
Contributor

Fixes #494

For openai_chat targets on the Responses API (gpt-5.4-pro, *-codex, codex-mini), tool calls came back as plain dicts. OfficeQA's tool loop uses tool_call.function.name, tool_call.id and tool_call.model_dump(), so any item that called a tool failed with 'dict' object has no attribute 'model_dump'.

_responses_to_chat_message now builds the message with the existing compat_message_from_responses_output, so tool calls look like Chat Completions ones. Content still comes from resp.output_text. SpreadsheetBench's ReAct agent gets the same dict shape as before, through model_dump().

Tests: new tests/test_officeqa_responses_tool_calls.py.

  • An OfficeQA process_one run 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 the model_dump error.
  • The ReAct agent's view of the same tool call is unchanged.

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.py also fail on main.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OfficeQA fails every tool call on Responses API targets (gpt-5.4-pro, codex models)

1 participant