diff --git a/api/core/memory/token_buffer_memory.py b/api/core/memory/token_buffer_memory.py index 5249e1520c..ea04b12ef4 100644 --- a/api/core/memory/token_buffer_memory.py +++ b/api/core/memory/token_buffer_memory.py @@ -109,9 +109,7 @@ class TokenBufferMemory: # If attachment filtering is enabled, filter MessageFile list first. if allowed_upload_ids is not None: - files = [ - f for f in files if f.upload_file_id and str(f.upload_file_id) in allowed_upload_ids - ] + files = [f for f in files if f.upload_file_id and str(f.upload_file_id) in allowed_upload_ids] if files: file_extra_config = None diff --git a/api/core/workflow/nodes/agent/agent_node.py b/api/core/workflow/nodes/agent/agent_node.py index 82130326ba..5f6db692f4 100644 --- a/api/core/workflow/nodes/agent/agent_node.py +++ b/api/core/workflow/nodes/agent/agent_node.py @@ -36,6 +36,7 @@ from extensions.ext_database import db from factories.agent_factory import get_plugin_agent_strategy from models.model import Conversation, NodeFileUsage + class AgentNode(ToolNode): """ Agent Node @@ -256,6 +257,7 @@ class AgentNode(ToolNode): value = cast(dict[str, Any], value) model_instance, model_schema = self._fetch_model(value) history_prompt_messages: list[dict[str, Any]] = [] + # Check if this agent node references sys.files def _input_uses_sys_files(_agent_input): if _agent_input.type == "variable":