feat: make agent runner config schema driven

This commit is contained in:
huanghuoguoguo
2026-05-19 12:20:28 +08:00
parent f4f91c43b5
commit be8d30894a
20 changed files with 901 additions and 236 deletions
@@ -132,7 +132,7 @@ class TestResolveRunnerConfig:
assert config == {'model': 'uuid-123', 'max_round': 10}
def test_resolve_old_format_config(self):
"""Resolve runner config from old format."""
"""Runtime config resolver should not read old format."""
pipeline_config = {
'ai': {
'local-agent': {
@@ -146,6 +146,23 @@ class TestResolveRunnerConfig:
pipeline_config,
'plugin:langbot/local-agent/default',
)
assert config == {}
def test_resolve_legacy_config_for_migration(self):
"""Migration helper should read old format."""
pipeline_config = {
'ai': {
'local-agent': {
'model': 'uuid-123',
'max_round': 10,
},
},
}
config = ConfigMigration.resolve_legacy_runner_config(
pipeline_config,
'plugin:langbot/local-agent/default',
)
assert config == {'model': 'uuid-123', 'max_round': 10}
def test_resolve_no_config(self):
@@ -228,4 +245,4 @@ class TestGetOldRunnerName:
def test_get_old_runner_name_not_mapped(self):
"""Get old runner name for unmapped runner ID."""
old_name = ConfigMigration.get_old_runner_name('plugin:alice/my-agent/custom')
assert old_name is None
assert old_name is None