From 4a37cc3d46e5d131100a2df3d0381a8a74f03688 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 15 May 2026 13:09:17 +0000 Subject: [PATCH] fix: register conversation ID with workspace for completion callback After creating a conversation, call workspace.register_conversation() so the conversation ID is included in the completion callback sent to the automation service. This fixes the UI showing 'Conversation not created' for runs that actually completed successfully. Fixes #113 Co-authored-by: openhands --- openhands/automation/presets/plugin/sdk_main.py | 4 ++++ openhands/automation/presets/prompt/sdk_main.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/openhands/automation/presets/plugin/sdk_main.py b/openhands/automation/presets/plugin/sdk_main.py index e6174ce..e2e6606 100644 --- a/openhands/automation/presets/plugin/sdk_main.py +++ b/openhands/automation/presets/plugin/sdk_main.py @@ -299,6 +299,10 @@ def event_callback(event) -> None: delete_on_close=False, # Keep conversation history after completion ) assert isinstance(conversation, RemoteConversation) + + # Register conversation ID with workspace for completion callback + workspace.register_conversation(str(conversation.id)) + print(f" conversation created: {type(conversation).__name__}") print(f" plugins loaded: {len(plugin_sources)}") diff --git a/openhands/automation/presets/prompt/sdk_main.py b/openhands/automation/presets/prompt/sdk_main.py index 2f884d7..4032e61 100644 --- a/openhands/automation/presets/prompt/sdk_main.py +++ b/openhands/automation/presets/prompt/sdk_main.py @@ -287,6 +287,10 @@ def event_callback(event) -> None: delete_on_close=False, # Keep conversation history after completion ) assert isinstance(conversation, RemoteConversation) + + # Register conversation ID with workspace for completion callback + workspace.register_conversation(str(conversation.id)) + print(f" conversation created: {type(conversation).__name__}") # Inject secrets into the conversation (as LookupSecret references)