mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-18 19:44:21 +00:00
feat: support dynamic agent runner defaults
This commit is contained in:
committed by
huanghuoguoguo
parent
3baf899c20
commit
6d0e6dcc63
@@ -1,4 +1,5 @@
|
||||
"""Tests for agent runner registry."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
@@ -10,14 +11,18 @@ from langbot.pkg.agent.runner.errors import RunnerNotFoundError, RunnerNotAuthor
|
||||
|
||||
class FakeApplication:
|
||||
"""Fake Application for testing."""
|
||||
|
||||
def __init__(self):
|
||||
class FakeLogger:
|
||||
def info(self, msg):
|
||||
pass
|
||||
|
||||
def debug(self, msg):
|
||||
pass
|
||||
|
||||
def warning(self, msg):
|
||||
pass
|
||||
|
||||
def error(self, msg):
|
||||
pass
|
||||
|
||||
@@ -234,13 +239,11 @@ class TestRegistryMetadataForPipeline:
|
||||
assert 'plugin:langbot/local-agent/default' in option_ids
|
||||
assert 'plugin:alice/my-agent/custom' in option_ids
|
||||
|
||||
# Should have stages for runners with config
|
||||
# Note: stages may be empty if config_schema is empty list
|
||||
# In real scenarios, runners with config_schema will generate stages
|
||||
# Only runners with non-empty config_schema generate stages
|
||||
# mock data has config: [{'name': 'param1', 'type': 'string'}] for alice/my-agent
|
||||
# but config is now taken from runner_data.get('config', [])
|
||||
assert len(stages) >= 0 # Can be 0 if all runners have empty config
|
||||
# Should fall back to manifest.spec.config when runtime does not return
|
||||
# extracted config at top level.
|
||||
assert len(stages) == 1
|
||||
assert stages[0]['name'] == 'plugin:alice/my-agent/custom'
|
||||
assert stages[0]['config'] == [{'name': 'param1', 'type': 'string'}]
|
||||
|
||||
|
||||
class TestDescriptorValidation:
|
||||
@@ -275,4 +278,4 @@ class TestDescriptorValidation:
|
||||
|
||||
assert descriptor.supports_streaming() is True
|
||||
assert descriptor.supports_tool_calling() is False
|
||||
assert descriptor.supports_knowledge_retrieval() is False
|
||||
assert descriptor.supports_knowledge_retrieval() is False
|
||||
|
||||
Reference in New Issue
Block a user