Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(agent): do not persist runtime context metadata in session history
Kim45ae410f0517
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.pyindex 3e513cb92..eb34b312c 100644--- a/nanobot/agent/loop.py+++ b/nanobot/agent/loop.py@@ -467,6 +467,14 @@ class AgentLoop:content = entry["content"]if len(content) > self._TOOL_RESULT_MAX_CHARS:entry["content"] = content[:self._TOOL_RESULT_MAX_CHARS] + "\n... (truncated)"+ if (+ entry.get("role") == "user"+ and isinstance(entry.get("content"), str)+ and entry["content"].startswith(ContextBuilder._RUNTIME_CONTEXT_TAG)+ ):+ # Runtime metadata is injected per-turn for model context only; do not persist it+ # into long-lived session history to avoid semantic drift and repetitive replies.+ continueif entry.get("role") == "user" and isinstance(entry.get("content"), list):entry["content"] = [{"type": "text", "text": "[image]"} if (