mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2959] [CLOSED] fix: ignore unrenderable optional prefix heads #4363
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#4363
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/2959
Author: @Tsury
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:fix/optional-prefix-template📝 Commits (1)
abf37e3fix: ignore unrenderable optional prefix heads📊 Changes
2 files changed (+27 additions, -2 deletions)
View changed files
📝
serve/server.py(+6 -2)📝
serve/test_server.py(+21 -0)📄 Description
A valid conversation can return HTTP 400 when
strata_prefixrenders a partial head that the model template rejects. For example, a system message followed by a user message is valid, but{"messages": 1}renders only the system message. Templates requiring a user query raiseTemplateRequestError: No user query found in messages.The same problem affects character prefixes ending in the system message.Catch
TemplateRequestErroronly while rendering the optional head and ignore that unusable prefix, asresolve_prefixalready promises. Full-request template validation and malformed prefix errors remain unchanged. Requests withoutstrata_prefixtake the existing path. This also applies alongside #2874; the repair does not depend on its image support.Validation on main
477ac13cbe8e582c20484871ce459d20d82df09d: the new regression fails before the fix with the template error, then all sixSharedPrefixtests pass. It checks both message/character forms, unchanged prepared tokens, the diagnostic, and continued rejection of invalid full requests. A separate local check alongside #2874 covers text/image requests; 13SharedPrefix/ImageMarkerstests pass. Python only; no native backend changed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.