Skip to content

Preserve omitted assistant content during OpenAI-compatible message round-tripping - #26473

Open
i386 wants to merge 1 commit into
ggml-org:masterfrom
Mesh-LLM:agent/llama-openai-content-presence
Open

Preserve omitted assistant content during OpenAI-compatible message round-tripping#26473
i386 wants to merge 1 commit into
ggml-org:masterfrom
Mesh-LLM:agent/llama-openai-content-presence

Conversation

@i386

@i386 i386 commented Aug 2, 2026

Copy link
Copy Markdown

Overview

Preserve omitted assistant content during OpenAI-compatible message round-tripping, instead of converting it to an empty string.

Incoming OpenAI-compatible message
{"role":"assistant","tool_calls":[...]}

Before
parse -> common_chat_msg(content = "")
serialize for chat template -> {"role":"assistant","content":"","tool_calls":[...]}

After
parse -> common_chat_msg(content_present = false)
serialize for chat template -> {"role":"assistant","tool_calls":[...]}

Requirements

  • YES I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, I used AI to find this bug, fix the code and I have manually reviewed it. Was found when running a benchmark against custom llama improvements.

…ontent field from empty string or null. some agents may break because of this.

Assisted-by: Codex
@i386
i386 requested review from a team and pwilkin as code owners August 2, 2026 20:45
@github-actions github-actions Bot added the testing Everything test related label Aug 2, 2026
@i386 i386 changed the title OpenAI-compatible chat-message parsing now distinguishes an omitted c… Preserve omitted assistant content during OpenAI-compatible message round-tripping Aug 2, 2026
@ggml-gh-bot

ggml-gh-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

Hi @i386, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • Multiple open PRs from a new contributor: We limit new contributors (those without a previously merged PR) to 1 open PR at a time. You currently have 2 open PRs.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

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

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant