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
docs: add note about ephemeral guard and per-call hooks contextvar
michaelxera19725bc57f0
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.pyindex 1f7906c1d..43662489a 100644--- a/nanobot/agent/loop.py+++ b/nanobot/agent/loop.py@@ -729,6 +729,10 @@ class AgentLoop:hook: AgentHook = loop_hookper_call = _per_call_hooks.get()extra_hooks = None+ # NOTE: SDK callers always go through run() → process_direct(ephemeral=False),+ # so per_call hooks are intentionally excluded from ephemeral turns. If a future+ # caller sets the contextvar and then calls process_direct(ephemeral=True), the+ # hooks will correctly NOT fire (ephemeral guard takes precedence).if not ephemeral:extra_hooks = per_call if per_call is not None else self._extra_hooksif extra_hooks: