From 78424353215d22f0d3d52c0bc3523268dc458534 Mon Sep 17 00:00:00 2001 From: miao <1468212639@qq.com> Date: Thu, 9 Apr 2026 20:01:07 +0800 Subject: [PATCH] fix(tools): forward set_runtime_context through OperationTool to base_tool OperationTool wraps builtin tools for multi-operation support but did not forward set_runtime_context, causing OpenClawTool to miss uploaded_files and conversation_id when used with operation routing. --- api/app/core/tools/builtin/operation_tool.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/app/core/tools/builtin/operation_tool.py b/api/app/core/tools/builtin/operation_tool.py index 495551af..a81ff951 100644 --- a/api/app/core/tools/builtin/operation_tool.py +++ b/api/app/core/tools/builtin/operation_tool.py @@ -11,6 +11,11 @@ class OperationTool(BaseTool): self.base_tool = base_tool self.operation = operation super().__init__(base_tool.tool_id, base_tool.config) + + def set_runtime_context(self, **kwargs): + """转发运行时上下文到 base_tool""" + if hasattr(self.base_tool, 'set_runtime_context'): + self.base_tool.set_runtime_context(**kwargs) @property def name(self) -> str: