fix: register conversation ID with workspace for completion callback#114
fix: register conversation ID with workspace for completion callback#114jpshackelford wants to merge 1 commit into
Conversation
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@all-hands.dev>
|
🚀 Deploy Preview PR Created/Updated A deploy preview has been created/updated for this PR. Deploy PR: https://github.com/OpenHands/deploy/pull/4296 Once the deploy PR's CI passes, the automation service will be deployed to the feature environment. |
|
@malhotra5 Not sure if this is the way you expected this to work. It seems a bit brittle. Another approach would be to have a separate job (similar to watchdog) that used data in the conversation tags to establish the linkage so we weren't depending on presets. |
| # Register conversation ID with workspace for completion callback | ||
| workspace.register_conversation(str(conversation.id)) | ||
|
|
There was a problem hiding this comment.
This should happen automatically inside the software agent sdk (when a workspace is passed to a conversation creation flow)
Reason is because we can't assume the user will always include this statement, it should be a default behavior
If this isn't working as of today, there is likely a regression inside the SDK
Summary
Fixes #113 - UI shows "Conversation not created" when conversations actually started successfully.
Problem
The preset scripts (
sdk_main.pyfor both prompt and plugin presets) create conversations but never callworkspace.register_conversation()to tell the workspace what conversation ID to include in the completion callback.When the workspace context manager exits, it sends a completion callback to the automation service, but
conversation_idis alwaysNonebecause it was never registered.Solution
After creating the conversation, call
workspace.register_conversation(str(conversation.id))so the conversation ID is included in the callback payload.Changes
openhands/automation/presets/prompt/sdk_main.py: Addworkspace.register_conversation()call after conversation creationopenhands/automation/presets/plugin/sdk_main.py: Addworkspace.register_conversation()call after conversation creationTesting
New automations created after this fix will include the
conversation_idin their completion callbacks, allowing the UI to link directly to the conversation.This PR was created by an AI agent (OpenHands) on behalf of the user.
@jpshackelford can click here to continue refining the PR