fix(llm): inject system prompt into user message for OpusAgent

OpusAgent topic system_prompt is used for summarization context but
not enforced as a binding instruction to Claude. Prepend [SYSTEM]
block to the first message of each session so Claude sees the full
JSON schema and grammar specification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adriano Dal Pastro
2026-05-26 09:42:26 +00:00
parent ba2c23e602
commit b8aa00b883
@@ -163,9 +163,11 @@ class LLMClient:
model = self._tier_map[genome.model_tier]
topic_id = self._get_or_create_topic(system)
prompt = f"[SYSTEM]\n{system}\n\n[USER]\n{user}" if session_id in (None, "new") else user
body: dict = {
"topic_id": topic_id,
"prompt": user,
"prompt": prompt,
"model": model,
}
if session_id is not None: