mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00:00
refactor(agent-runner): remove protocol_version from various components and update related documentation
This commit is contained in:
@@ -159,4 +159,4 @@ class TestBuildAdapterContext:
|
||||
|
||||
context = QueryEntryAdapter.build_adapter_context(query, binding=None)
|
||||
|
||||
assert context == {'params': {}, 'query_id': 123, 'prompt_get': False}
|
||||
assert context == {'params': {}, 'query_id': 123}
|
||||
|
||||
@@ -56,7 +56,6 @@ class TestContextAccessStateDetermination:
|
||||
"""Create mock runner descriptor."""
|
||||
descriptor = MagicMock()
|
||||
descriptor.id = 'plugin:test/runner/default'
|
||||
descriptor.protocol_version = '1.0'
|
||||
descriptor.permissions = {}
|
||||
return descriptor
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ class TestContextValidation:
|
||||
"""Create a mock runner descriptor."""
|
||||
descriptor = MagicMock()
|
||||
descriptor.id = "plugin:test/plugin/runner"
|
||||
descriptor.protocol_version = "1"
|
||||
descriptor.permissions = {
|
||||
'history': ['page', 'search'],
|
||||
'events': ['get', 'page'],
|
||||
@@ -145,8 +144,7 @@ class TestContextValidation:
|
||||
assert isinstance(validated.resources, AgentResources)
|
||||
assert validated.runtime is not None
|
||||
assert isinstance(validated.runtime, AgentRuntimeContext)
|
||||
assert validated.runtime.protocol_version == "1"
|
||||
assert "protocol_version" in validated.runtime.model_dump()
|
||||
assert "protocol_version" not in validated.runtime.model_dump()
|
||||
assert "sdk_protocol_version" not in validated.runtime.model_dump()
|
||||
assert "sdk_protocol_version" not in context_dict["runtime"]
|
||||
|
||||
|
||||
@@ -153,7 +153,6 @@ def make_descriptor() -> AgentRunnerDescriptor:
|
||||
plugin_author="langbot",
|
||||
plugin_name="local-agent",
|
||||
runner_name="default",
|
||||
protocol_version="1",
|
||||
capabilities={
|
||||
"streaming": True,
|
||||
"tool_calling": True,
|
||||
@@ -591,7 +590,7 @@ class TestQueryEntryAdapterParams:
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_prompt_not_pushed_into_adapter_extra(self, clean_agent_state):
|
||||
"""Pipeline prompt is not pushed into adapter.extra."""
|
||||
"""Pipeline prompt is not pushed into adapter.extra or exposed via prompt_get."""
|
||||
from langbot_plugin.api.entities.builtin.provider import prompt as provider_prompt
|
||||
|
||||
db_engine = clean_agent_state
|
||||
@@ -621,7 +620,7 @@ class TestQueryEntryAdapterParams:
|
||||
context = plugin_connector.contexts[0]
|
||||
assert "prompt" not in context
|
||||
assert "prompt" not in context["adapter"]["extra"]
|
||||
assert context["context"]["available_apis"]["prompt_get"] is True
|
||||
assert "prompt_get" not in context["context"]["available_apis"]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_params_filtering_keeps_public_param(self, clean_agent_state):
|
||||
|
||||
@@ -45,7 +45,6 @@ class FakeApplication:
|
||||
'label': {'en_US': 'Local Agent'},
|
||||
},
|
||||
'spec': {
|
||||
'protocol_version': '1',
|
||||
'config': [],
|
||||
'capabilities': {'streaming': True},
|
||||
'permissions': {},
|
||||
@@ -63,7 +62,6 @@ class FakeApplication:
|
||||
'label': {'en_US': 'Custom Agent'},
|
||||
},
|
||||
'spec': {
|
||||
'protocol_version': '1',
|
||||
'config': [{'name': 'param1', 'type': 'string'}],
|
||||
'capabilities': {},
|
||||
'permissions': {},
|
||||
@@ -266,7 +264,7 @@ class TestDescriptorValidation:
|
||||
|
||||
assert descriptor.id == 'plugin:test/my-runner/default'
|
||||
assert descriptor.get_plugin_id() == 'test/my-runner'
|
||||
assert descriptor.protocol_version == '1'
|
||||
assert 'protocol_version' not in AgentRunnerDescriptor.model_fields
|
||||
|
||||
def test_descriptor_capabilities(self):
|
||||
"""Descriptor capability helper methods."""
|
||||
|
||||
@@ -35,7 +35,6 @@ def make_descriptor():
|
||||
plugin_author='langbot',
|
||||
plugin_name='local-agent',
|
||||
runner_name='default',
|
||||
protocol_version='1',
|
||||
capabilities={'streaming': True},
|
||||
)
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ def make_descriptor(runner_id: str = 'plugin:test/my-runner/default') -> AgentRu
|
||||
plugin_author='test',
|
||||
plugin_name='my-runner',
|
||||
runner_name='default',
|
||||
protocol_version='1',
|
||||
capabilities={'streaming': True},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user