Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/adapters/openai-chat/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function messagesToChatFormat(parsed: OcxParsedRequest, provider: OcxProv
const nativeOpenAI = isNativeOpenAIChatTarget(provider);
// Qwen3.8-27B's pinned chat template rejects non-leading system and every developer role;
// a later user is rendered in place. Keep this exception specific to that template family.
const qwen38LeadingSystemTemplate = !nativeOpenAI && /^(?:Qwen\/)?Qwen3\.8-27B$/i.test(parsed.modelId);
const qwen38LeadingSystemTemplate = !nativeOpenAI && /^(?:Qwen\/)?(?:Qwen3\.8-27B|qwen3-8-27b(?:-(?:fp8|lora))?)$/i.test(parsed.modelId);
// Which role a developer message carries, and why the unrecorded state folds, is stated once
// in ./developer-role.ts and read from there by the native passthrough as well. Either way the
// message keeps the slot it arrived in — only the role changes, never the position.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ function assertTemplateAccepts(messages: Array<{ role: string }>): void {
}

describe("Qwen3.8-27B leading-system template", () => {
test.each(["Qwen3.8-27B", "Qwen/Qwen3.8-27B"])("keeps a late reminder after the first user without an invalid system role: %s", modelId => {
test.each([
"Qwen3.8-27B",
"Qwen/Qwen3.8-27B",
// Internal Eliza serves the same pinned template under dashed checkpoint ids.
"qwen3-8-27b-fp8",
"qwen3-8-27b-lora",
])("keeps a late reminder after the first user without an invalid system role: %s", modelId => {
const messages = serialize(modelId);
expect(messages).toEqual([
{ role: "system", content: "Base instructions." },
Expand Down
Loading