mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5249] [Engine] content is "" (not null) when a reply has no text and no tool call #5362
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5362
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5249
Author: @festeraeb
Created: 11/4/2026
Status: 🔄 Open
Base:
main← Head:fix/content-empty-not-null📝 Commits (1)
873cd77[Engine] content is "" (not null) when a reply has no text and no tool call📊 Changes
2 files changed (+21 additions, -1 deletions)
View changed files
📝
serve/server.py(+3 -1)📝
serve/test_server.py(+18 -0)📄 Description
Problem. A non-streamed chat completion that runs out of
max_tokenswhile the model is still thinking comes back with"content": nulland onlyreasoning_content. Clients and proxies that require a string reject it. We hit it routing Strata's server through Lemonade as an OpenAI provider: Lemonade's provider route fails withtype must be string, but is null.Behavior after.
openai_collectkeepscontent: nullonly when the message carries tool calls, which is how OpenAI sends it. A reply with no text and no tool call gets"". Text, reasoning and tool calls are unchanged. The streamed path is not affected; it never builds this message.Validation (revision
ffa80d7+ this change, Ubuntu 24.04, Python 3.12.3):python -m unittest serve.test_server: 360 tests, OK.UnfinishedToolCall.test_collect_content_is_null_only_beside_tool_calls, and it fails without the change (AssertionError: None != '').Related: #1392 (the web app drops a reply with empty content) is a separate case, not changed here.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.