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.
This commit is contained in:
@@ -12,6 +12,11 @@ class OperationTool(BaseTool):
|
||||
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:
|
||||
return f"{self.base_tool.name}_{self.operation}"
|
||||
|
||||
Reference in New Issue
Block a user