JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(memory): change claw to agent when get config
zhaoyulu1297642fba0e9
diff --git a/jiuwenclaw/agentserver/deep_agent/interface_deep.py b/jiuwenclaw/agentserver/deep_agent/interface_deep.pyindex 89d655d36a..f05b1d9913 100644--- a/jiuwenclaw/agentserver/deep_agent/interface_deep.py+++ b/jiuwenclaw/agentserver/deep_agent/interface_deep.py@@ -1782,7 +1782,7 @@ class JiuWenClawDeepAdapter:if getattr(existing, "name", "").startswith(("session_new", "session_cancel", "session_list")):self._instance.ability_manager.remove(existing.name)# plan 模式,根据config选择是否注册或者卸载memory rail- await self._handle_memory_rail_by_config("agent.plan")+ await self._handle_memory_rail_by_config("plan")# 恢复上下文 rail(仅配置启用时)if self._config_cache.get("context_engine_config", {}).get("enabled", False):if self._context_engineering_rail is not None and self._context_engineering_rail_mode != "agent.plan":diff --git a/jiuwenclaw/agentserver/memory/config.py b/jiuwenclaw/agentserver/memory/config.pyindex 19b6655149..8969f1c1ea 100644--- a/jiuwenclaw/agentserver/memory/config.py+++ b/jiuwenclaw/agentserver/memory/config.py@@ -197,7 +197,7 @@ def is_memory_enabled(mode: str, config: Optional[Dict[str, Any]] = None) -> boo(avoids stale cache). Otherwise reads from config.yaml."""try:- memory_config = (config or {}).get("modes", {}).get("claw", {}).get(mode, {}).get("memory", {})+ memory_config = (config or {}).get("modes", {}).get("agent", {}).get(mode, {}).get("memory", {})return memory_config.get("enabled", False)except Exception as e:logger.warning(f"Invalid memory config, disable memory, error: {e}")@@ -211,7 +211,7 @@ def is_proactive_memory(mode: str, config: Optional[Dict[str, Any]] = None) -> bWhen False: agent only records/searches when user explicitly asks."""try:- memory_config = (config or {}).get("modes", {}).get("claw", {}).get(mode, {}).get("memory", {})+ memory_config = (config or {}).get("modes", {}).get("agent", {}).get(mode, {}).get("memory", {})return memory_config.get("is_proactive", False)except Exception as e:logger.warning(f"Invalid memory config, disable proactive memory, error: {e}")