[PR #2285] [CLOSED] fix(serve): preserve late instruction roles across adapters #3960

Closed
opened 2026-11-07 15:32:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2285
Author: @Tsury
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/native-roles


📝 Commits (1)

  • c680df8 fix(serve): preserve late instruction roles across adapters

📊 Changes

5 files changed (+22 additions, -21 deletions)

View changed files

📝 serve/chat_template.jinja (+4 -3)
📝 serve/frontend.py (+2 -10)
📝 serve/responses.py (+3 -3)
📝 serve/test_responses.py (+2 -2)
📝 serve/test_server.py (+11 -3)

📄 Description

Late system/developer messages currently become user messages on the Chat, Messages and Responses paths. Their position survives, but their instruction role does not.

Preserve the role through adapters and render late system/developer content as system messages in the bundled template. Keep leading instruction merging and the existing rejection of images in system content. Remove the conversion helper and its imports.

Based on main a0116b2782a5b82622358c04a06496485d12b2d6. Related #56 fixed template refusal by changing late roles to user; this change retains the accepted messages' instruction role instead. Custom templates remain responsible for their own accepted roles.

Validation: 52 focused model-free client/Responses tests pass. The strengthened existing HTTP tests fail on stock for the missing system-role markers and pass after this change. They verify order and one occurrence of each late instruction. No new GPU workload or deployment, and no model-quality or throughput claim.

Command: python3 -m unittest serve.test_server.ClientShapes serve.test_responses.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2285 **Author:** [@Tsury](https://github.com/Tsury) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/native-roles` --- ### 📝 Commits (1) - [`c680df8`](https://github.com/Niko1221/Strata/commit/c680df83a17aaf31154586aef40b9580074d5e03) fix(serve): preserve late instruction roles across adapters ### 📊 Changes **5 files changed** (+22 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `serve/chat_template.jinja` (+4 -3) 📝 `serve/frontend.py` (+2 -10) 📝 `serve/responses.py` (+3 -3) 📝 `serve/test_responses.py` (+2 -2) 📝 `serve/test_server.py` (+11 -3) </details> ### 📄 Description Late system/developer messages currently become user messages on the Chat, Messages and Responses paths. Their position survives, but their instruction role does not. Preserve the role through adapters and render late system/developer content as system messages in the bundled template. Keep leading instruction merging and the existing rejection of images in system content. Remove the conversion helper and its imports. Based on main `a0116b2782a5b82622358c04a06496485d12b2d6`. Related #56 fixed template refusal by changing late roles to user; this change retains the accepted messages' instruction role instead. Custom templates remain responsible for their own accepted roles. Validation: 52 focused model-free client/Responses tests pass. The strengthened existing HTTP tests fail on stock for the missing system-role markers and pass after this change. They verify order and one occurrence of each late instruction. No new GPU workload or deployment, and no model-quality or throughput claim. Command: `python3 -m unittest serve.test_server.ClientShapes serve.test_responses`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3960
No description provided.