From fd3348ae596cadf189ab861fdd4363692ea0d07d Mon Sep 17 00:00:00 2001 From: Sasnouski Mikalai Date: Tue, 11 Aug 2026 14:24:56 +0300 Subject: [PATCH] fix: merge injected system block into the first system message The plugin appended a second system message via experimental.chat.system.transform, which proxies like litellm/vLLM reject with 'System message must be at the beginning' (400). Append the block to the existing system message instead. --- bulba.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bulba.mjs b/bulba.mjs index 63a8ece..35e2955 100644 --- a/bulba.mjs +++ b/bulba.mjs @@ -952,9 +952,14 @@ Be specific, cite mechanisms, no vibes.`, } catch {} }, // Memory/goal/rules injected every turn. + // Одно system-сообщение: прокси вроде litellm/vLLM отвергают несколько + // system-сообщений ("System message must be at the beginning") - дописываем + // блок к существующему system, а не пушим отдельным сообщением. "experimental.chat.system.transform": async (_input, output) => { const block = systemBlock() - if (block) output.system.push(block) + if (!block) return + if (output.system.length > 0) output.system[0] += `\n\n${block}` + else output.system.push(block) }, // AGENTS.md-правила + активная работа: прямо в результаты тулов (как omo, без roundtrip). "tool.execute.after": async (input, output) => {