Skip to content

Commit d0cb55c

Browse files
feat(marketplace): expose load_plugin on base conversation
Add a BaseConversation load_plugin API surface with a default unsupported implementation for custom conversation subclasses. Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 82401ac commit d0cb55c

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

openhands-sdk/openhands/sdk/conversation/base.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,19 @@ def execute_tool(self, tool_name: str, action: Action) -> Observation:
378378
"""
379379
...
380380

381+
def load_plugin(self, plugin_ref: str) -> None:
382+
"""Load a plugin from a registered marketplace.
383+
384+
Implementations that support marketplace-registered plugins resolve the
385+
reference against the conversation agent's registered marketplaces and
386+
merge the plugin's skills, hooks, and MCP configuration into the agent.
387+
388+
Args:
389+
plugin_ref: Plugin reference, either ``plugin-name`` or
390+
``plugin-name@marketplace-name``.
391+
"""
392+
raise NotImplementedError("This conversation does not support loading plugins")
393+
381394
@abstractmethod
382395
def fork(
383396
self,

tests/sdk/conversation/test_base_span_management.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from unittest.mock import MagicMock, patch
66
from uuid import UUID
77

8+
import pytest
9+
810
from openhands.sdk.conversation.base import BaseConversation
911
from openhands.sdk.conversation.conversation_stats import ConversationStats
1012
from openhands.sdk.conversation.types import TraceMetadataValue
@@ -74,6 +76,13 @@ def fork(self, **kwargs: Any) -> "MockConversation":
7476
raise NotImplementedError("Mock fork not implemented")
7577

7678

79+
def test_base_conversation_load_plugin_default_not_supported():
80+
conversation = MockConversation()
81+
82+
with pytest.raises(NotImplementedError, match="does not support loading plugins"):
83+
conversation.load_plugin("plugin@marketplace")
84+
85+
7786
def test_base_conversation_span_management():
7887
"""Test that BaseConversation properly manages span state to prevent double-ending.""" # noqa: E501
7988

0 commit comments

Comments
 (0)