From 81758b9a54b8aa2e094a6a58cded5a2ae51ad59e Mon Sep 17 00:00:00 2001 From: zhi Date: Sat, 28 Feb 2026 19:24:50 +0000 Subject: [PATCH] fix: use systemPrompt instead of prependContext for end marker instruction - Change before_prompt_build hook to return systemPrompt instead of prependContext - This ensures the end marker instruction is injected once per session as a system prompt, not repeatedly prepended to each user message - Add moderatorBotToken to CONFIG.example.json for documentation --- docs/CONFIG.example.json | 3 ++- plugin/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/CONFIG.example.json b/docs/CONFIG.example.json index d14f120..a18ed96 100644 --- a/docs/CONFIG.example.json +++ b/docs/CONFIG.example.json @@ -22,7 +22,8 @@ "debugLogChannelIds": [], "discordControlApiBaseUrl": "http://127.0.0.1:8790", "discordControlApiToken": "", - "discordControlCallerId": "agent-main" + "discordControlCallerId": "agent-main", + "moderatorBotToken": "" } } } diff --git a/plugin/index.ts b/plugin/index.ts index 2dd9411..0959331 100644 --- a/plugin/index.ts +++ b/plugin/index.ts @@ -726,8 +726,8 @@ export default { if (idStr) identity = idStr + "\n\n"; } - api.logger.info(`whispergate: prepend end marker instruction for session=${key}, reason=${rec.decision.reason} isGroupChat=${isGroupChat}`); - return { prependContext: identity + instruction }; + api.logger.info(`whispergate: set system prompt for session=${key}, reason=${rec.decision.reason} isGroupChat=${isGroupChat}`); + return { systemPrompt: identity + instruction }; }); // Register slash commands for Discord