Release GJ — v0.51.216 (fix consecutive-user-turn rejection on strict chat templates) - #3434
Merged
Merged
Conversation
…prefill user message (#3324, @aether-agent) Consecutive user turns (session-context prefill + actual message) made models with strict chat templates (Mistral, Gemma via llama.cpp) reject the request with a Jinja 500. Move the platform/delivery context (connected platforms, home channels, scheduled-task delivery hints) from _webui_session_context_message (a prefill user message) into _webui_delivery_context_prompt, appended to the ephemeral system prompt. Session framing stays in _webui_surface_context_prompt. Context is preserved — just role-alternation-safe. Closes #3276. Co-authored-by: aether-agent <aether-agent@users.noreply.github.com>
… (Codex MUST-FIX on #3324) #3324 moved the WebUI session/delivery context from a prefill user message into _webui_ephemeral_system_prompt, but the gateway-backed WebUI chat path built its own system message from the bare _WEBUI_PROGRESS_PROMPT + prefill helper — which now returns only recall prefill. That silently dropped connected platforms, home channels, delivery hints, and session framing on Gateway-routed WebUI chats (same #3278 data-drop class, on the path the author missed). Build the gateway request's system message with _webui_ephemeral_system_prompt(surface_context, config_data=cfg) so the context is preserved. Regression test asserts the delivery context is present in the gateway system message.
…cation (Opus MUST-FIX) test_webui_session_context_adds_gateway_like_metadata asserted the removed prefill-user-message API. Rewrote it to assert (a) the prefill helper no longer appends a session-context user message, and (b) the same gateway-like metadata (connected platforms, paused-platform exclusion, home-channel name shown, chat_id never leaks) is now carried in _webui_ephemeral_system_prompt.
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
Release GJ — v0.51.216 (fix consecutive-user-turn rejection on strict chat templates)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release GJ — v0.51.216 (stage-p2e)
Phase 2 medium-risk advance. Single PR — a provider-compatibility fix to the WebUI chat prompt-assembly path.
PR in this release
usermessage. The old prefill produced two consecutiveuserturns (session context + actual message), which models with strict chat templates (Mistral, Gemma via llama.cpp) reject with a Jinja 500. The same context is preserved — just delivered role-alternation-safely. Closes bug: consecutive user messages in WebUI prefill cause Jinja 500 with strict chat templates (Mistral, Gemma) #3276.Maintainer fixes applied during the gate
gateway_chat.py) built its own system message from the bare_WEBUI_PROGRESS_PROMPT+ that helper — so it silently dropped connected platforms / home channels / delivery hints / session framing on Gateway-routed chats (same fix: remove duplicate session context prefill that breaks strict chat templates (Mistral, Gemma) #3278 data-drop class, on the path the author missed). Fixed: the gateway request's system message is now built via_webui_ephemeral_system_prompt(surface_context, config_data=cfg). Regression test asserts the delivery context is present in the gateway system message.test_webui_session_context_adds_gateway_like_metadata(asserted the removed prefill-user-message API) to assert the metadata now lives in the ephemeral system prompt (connected platforms, paused-platform exclusion, home-channel name shown, chat_id never leaks).Follow-up filed
usermessage could still produce consecutive user turns) + the unused_handle_chat_syncpath. Both pre-date fix: fold session context into ephemeral system prompt instead of prefill (Mistral, Gemma) #3324 and are strictly better after it (master always appended a user context message); filed for separate hardening.Verification
git merge-base --is-ancestor+ grep that the fix is in stage HEAD); finding Hermes Web UI — Sprints 11-14: multi-provider models, settings, sessi… #2 pre-existing → Harden recall-prefill role adjacency on WebUI chat paths (strict chat templates) #3432