sync update from LAN repo (source master-nj @ 067eb808)

This commit is contained in:
gozeros committed 2026-11-10 14:04:09 +08:00
1 parent 1244fb1f2f
commit 1d5dd8fc90
182 files changed
+18973 -769

No files matched your search

@@ -29,7 +29,8 @@ from deerflow.agents.middlewares.tool_error_handling_middleware import build_lea
from deerflow.agents.middlewares.view_image_middleware import ViewImageMiddleware
from deerflow.agents.thread_state import ThreadState
from deerflow.config.agents_config import load_agent_config, load_agent_soul, validate_agent_id
from deerflow.config.app_config import AppConfig, get_app_config
from deerflow.config.app_config import AppConfig, get_app_config
from deerflow.config.system_settings import get_memory_runtime_settings
from deerflow.models import create_chat_model
logger = logging.getLogger(__name__)
@@ -433,8 +434,14 @@ def _build_middlewares(
# Add MemoryMiddleware (after TitleMiddleware) — skip in bootstrap mode (agent creation flow) and ephemeral runs
memory_injection_enabled = cfg.get("memory_injection_enabled", True)
if not is_bootstrap and not is_writing_setup and not is_report_structure_setup and not is_ephemeral:
middlewares.append(MemoryMiddleware(agent_name=agent_name, memory_config=resolved_app_config.memory, injection_enabled=memory_injection_enabled))
if (
get_memory_runtime_settings().enabled
and not is_bootstrap
and not is_writing_setup
and not is_report_structure_setup
and not is_ephemeral
):
middlewares.append(MemoryMiddleware(agent_name=agent_name, injection_enabled=memory_injection_enabled))
# KnowledgeRagMiddleware — inject knowledge-base recall (phase 2). Gated
# per-conversation by the ``knowledge_rag_enabled`` runtime flag, defaulting
@@ -854,6 +861,10 @@ def _make_lead_agent(config: RunnableConfig, *, app_config: AppConfig):
system_prompt = _append_orchestration_capability_boundary(system_prompt, agent_id)
from deerflow.agents.analysis_project import project_system_prompt
system_prompt += project_system_prompt(cfg)
_log_es_query_routing_registration(
system_prompt=system_prompt,
app_config=resolved_app_config,