mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-08 23:06:03 +00:00
refactor agent runner orchestration boundaries
This commit is contained in:
@@ -18,6 +18,7 @@ from unittest.mock import AsyncMock, Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from langbot.pkg.agent.runner.default_config import AgentRunnerDefaultConfigService
|
||||
from langbot.pkg.agent.runner.descriptor import AgentRunnerDescriptor
|
||||
from langbot.pkg.api.http.service.model import (
|
||||
LLMModelsService,
|
||||
@@ -432,6 +433,7 @@ class TestLLMModelsServiceCreateLLMModel:
|
||||
ap.model_mgr.load_llm_model_with_provider = AsyncMock(return_value=Mock())
|
||||
ap.pipeline_service = SimpleNamespace(update_pipeline=AsyncMock())
|
||||
ap.agent_runner_registry = FakeAgentRunnerRegistry()
|
||||
ap.agent_runner_default_config_service = AgentRunnerDefaultConfigService(ap)
|
||||
|
||||
pipeline = SimpleNamespace(
|
||||
uuid='pipeline-uuid',
|
||||
|
||||
@@ -37,7 +37,7 @@ def make_runner(runner_id: str, config_schema: list[dict]):
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_default_pipeline_config_uses_installed_local_agent_schema():
|
||||
async def test_default_pipeline_config_uses_first_installed_runner_schema():
|
||||
local_agent = make_runner(
|
||||
'plugin:langbot/local-agent/default',
|
||||
[
|
||||
@@ -56,11 +56,10 @@ async def test_default_pipeline_config_uses_installed_local_agent_schema():
|
||||
|
||||
config = await PipelineService(ap).get_default_pipeline_config()
|
||||
|
||||
assert config['ai']['runner']['id'] == 'plugin:langbot/local-agent/default'
|
||||
assert config['ai']['runner']['id'] == 'plugin:alice/custom-agent/default'
|
||||
assert config['ai']['runner_config'] == {
|
||||
'plugin:langbot/local-agent/default': {
|
||||
'model': {'primary': '', 'fallbacks': []},
|
||||
'prompt': [{'role': 'system', 'content': 'Hello'}],
|
||||
'plugin:alice/custom-agent/default': {
|
||||
'api-key': '',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user