1 Commits

Author SHA1 Message Date
Adriano Dal Pastro b8aa00b883 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>
2026-05-26 09:42:26 +00:00
@@ -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: