Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor: add missing @override decorator to file access controller and workflow file runtime (#36495)
Sven Weidenmann618501691039
diff --git a/api/core/app/file_access/controller.py b/api/core/app/file_access/controller.pyindex a6c6e74f068..fd4f350e25d 100644--- a/api/core/app/file_access/controller.py+++ b/api/core/app/file_access/controller.py@@ -1,6 +1,7 @@from __future__ import annotationsfrom collections.abc import Callable+from typing import overridefrom sqlalchemy import and_, or_, selectfrom sqlalchemy.orm import Session@@ -31,9 +32,11 @@ class DatabaseFileAccessController(FileAccessControllerProtocol):) -> None:self._scope_getter = scope_getter+ @overridedef current_scope(self) -> FileAccessScope | None:return self._scope_getter()+ @overridedef apply_upload_file_filters(self,stmt: Select[tuple[UploadFile]],@@ -62,6 +65,7 @@ class DatabaseFileAccessController(FileAccessControllerProtocol):))+ @overridedef apply_tool_file_filters(self,stmt: Select[tuple[ToolFile]],@@ -78,6 +82,7 @@ class DatabaseFileAccessController(FileAccessControllerProtocol):return scoped_stmt.where(ToolFile.user_id == resolved_scope.user_id)+ @overridedef get_upload_file(self,*,@@ -95,6 +100,7 @@ class DatabaseFileAccessController(FileAccessControllerProtocol):)return session.scalar(stmt)+ @overridedef get_tool_file(self,*,diff --git a/api/core/app/workflow/file_runtime.py b/api/core/app/workflow/file_runtime.pyindex 587f7002866..90fdf410227 100644--- a/api/core/app/workflow/file_runtime.py+++ b/api/core/app/workflow/file_runtime.py@@ -7,7 +7,7 @@ import osimport timeimport urllib.parsefrom collections.abc import Generator-from typing import TYPE_CHECKING, Literal+from typing import TYPE_CHECKING, Literal, overridefrom configs import dify_configfrom core.app.file_access import DatabaseFileAccessController, FileAccessControllerProtocol@@ -40,15 +40,19 @@ class DifyWorkflowFileRuntime(WorkflowFileRuntimeProtocol):self._file_access_controller = file_access_controller@property+ @overridedef multimodal_send_format(self) -> str:return dify_config.MULTIMODAL_SEND_FORMAT+ @overridedef http_get(self, url: str, *, follow_redirects: bool = True) -> HttpResponseProtocol:return graphon_ssrf_proxy.get(url, follow_redirects=follow_redirects)+ @overridedef storage_load(self, path: str, *, stream: bool = False) -> bytes | Generator:return storage.load(path, stream=stream)+ @overridedef load_file_bytes(self, *, file: File) -> bytes:storage_key = self._resolve_storage_key(file=file)data = storage.load(storage_key, stream=False)@@ -56,6 +60,7 @@ class DifyWorkflowFileRuntime(WorkflowFileRuntimeProtocol):raise ValueError(f"file {storage_key} is not a bytes object")return data+ @overridedef resolve_file_url(self, *, file: File, for_external: bool = True) -> str | None:if file.transfer_method == FileTransferMethod.REMOTE_URL:return file.remote_url@@ -86,6 +91,7 @@ class DifyWorkflowFileRuntime(WorkflowFileRuntimeProtocol):)return None+ @overridedef resolve_upload_file_url(self,*,@@ -101,10 +107,12 @@ class DifyWorkflowFileRuntime(WorkflowFileRuntimeProtocol):query["as_attachment"] = "true"return f"{url}?{urllib.parse.urlencode(query)}"+ @overridedef resolve_tool_file_url(self, *, tool_file_id: str, extension: str, for_external: bool = True) -> str:self._assert_tool_file_access(tool_file_id=tool_file_id)return sign_tool_file(tool_file_id=tool_file_id, extension=extension, for_external=for_external)+ @overridedef verify_preview_signature(self,*,