Skip to content

Fix overwriting content with only last element#4166

Open
mzegla wants to merge 3 commits intomainfrom
fix_content_overwrite
Open

Fix overwriting content with only last element#4166
mzegla wants to merge 3 commits intomainfrom
fix_content_overwrite

Conversation

@mzegla
Copy link
Copy Markdown
Collaborator

@mzegla mzegla commented Apr 28, 2026

No description provided.

major rework

minor changes

less restrictive bos/eos check

revert rework
@mzegla mzegla force-pushed the fix_content_overwrite branch from cc9af72 to 6ba3abd Compare May 5, 2026 12:37
@mzegla mzegla marked this pull request as ready for review May 5, 2026 12:38
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 fixes OpenAI Chat Completions request parsing so that when a message content is provided as an array of parts (e.g., multimodal with multiple text segments), the flattened "content" string no longer gets overwritten by only the last text element.

Changes:

  • Replace single-value assignment of nested "text" parts with accumulation into a combined string.
  • Update the flattening behavior to write the combined text back into the "content" field while continuing to store images in request.imageHistory.

Comment thread src/llm/apis/openai_completions.cpp Outdated
Comment thread src/llm/apis/openai_completions.cpp
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.

4 participants