Skip to content

Responses minor fix + UTs#4225

Open
michalkulakowski wants to merge 1 commit into
mainfrom
mkulakow/fix_responses_3
Open

Responses minor fix + UTs#4225
michalkulakowski wants to merge 1 commit into
mainfrom
mkulakow/fix_responses_3

Conversation

@michalkulakowski
Copy link
Copy Markdown
Collaborator

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

Copilot AI review requested due to automatic review settings May 20, 2026 11:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates OVMS’s OpenAI Responses behavior to better match vLLM/OpenAI client expectations around (1) how historical reasoning is replayed in multi-turn conversations and (2) how Responses output[] is serialized when the model emits tool calls without any text. It also expands test coverage for multimodal image parsing and media authorization allowlists.

Changes:

  • Add a post-processing step to drop/strip stale reasoning_content from earlier assistant turns before the last “final answer” assistant turn when building chat/completions-shaped messages from a Responses input[].
  • Update Responses serialization to omit the message output item when no text content was produced (tool-calls-only outputs).
  • Extend unit tests for multimodal images (base64, local filesystem allowlist, domain allowlist) and for Responses input_image.image_url accepted shapes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/llm/apis/openai_responses.cpp Adds dropHistoricalReasoning() post-processing to the Responses-input builder sinks; skips emitting empty message output items when no text was generated.
src/test/http_openai_handler_test.cpp Adds extensive parsing/authorization tests for images and multi-turn reasoning-drop behavior; adds Responses-only coverage for input_image.image_url shape variants and negative cases.

Comment thread src/llm/apis/openai_responses.cpp Outdated
Comment on lines +548 to +552
auto msg = messages[static_cast<size_t>(i)];
if (!msg.contains("role") || msg["role"].get_string() != "assistant")
continue;
if (!msg.contains("reasoning_content"))
continue;
Comment thread src/test/http_openai_handler_test.cpp Outdated
})");
}

TEST_F(HttpOpenAIHandlerParsingTest, ResponsesDropHistoricalReasoningPreservesReasoningOnAssistantWithToolCalls) {
@michalkulakowski michalkulakowski changed the title Fix reasoning Responses minor fix + UTs May 20, 2026
@michalkulakowski michalkulakowski force-pushed the mkulakow/fix_responses_3 branch from 89f1d2b to f93c025 Compare May 20, 2026 11:48
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.

2 participants