From 95ef8965b72a1fb9028ff83c4bb910da041481c2 Mon Sep 17 00:00:00 2001 From: olyashok <50547198+olyashok@users.noreply.github.com> Date: Sat, 16 Aug 2025 17:29:28 -0400 Subject: [PATCH] Allow user actions over websockets (#10420) Co-authored-by: Xingyao Wang Co-authored-by: Xingyao Wang --- openhands/memory/conversation_memory.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/openhands/memory/conversation_memory.py b/openhands/memory/conversation_memory.py index 310e288aab..912f287762 100644 --- a/openhands/memory/conversation_memory.py +++ b/openhands/memory/conversation_memory.py @@ -234,8 +234,23 @@ class ConversationMemory: ), ) or (isinstance(action, CmdRunAction) and action.source == 'agent'): tool_metadata = action.tool_call_metadata + + # Allow user actions to skip tool metadata validation + if action.source == 'user' and tool_metadata is None: + # For user-initiated actions without tool metadata, create a simple message + return [ + Message( + role='user', + content=[ + TextContent( + text=f'User requested to read file: {str(action)}' + ) + ], + ) + ] + assert tool_metadata is not None, ( - 'Tool call metadata should NOT be None when function calling is enabled. Action: ' + 'Tool call metadata should NOT be None when function calling is enabled for agent actions. Action: ' + str(action) )