refactor(agent-runner): use sandbox file model

This commit is contained in:
huanghuoguoguo
2026-06-19 09:30:12 +08:00
parent 2c09af406e
commit 79a5fba06b
49 changed files with 203 additions and 3401 deletions
+16 -27
View File
@@ -39,16 +39,12 @@ class FakeApplication:
'plugin_name': 'local-agent',
'runner_name': 'default',
'manifest': {
'kind': 'AgentRunner',
'metadata': {
'name': 'default',
'label': {'en_US': 'Local Agent'},
},
'spec': {
'config': [],
'capabilities': {'streaming': True},
'permissions': {},
},
'id': 'plugin:langbot/local-agent/default',
'name': 'default',
'label': {'en_US': 'Local Agent'},
'capabilities': {'streaming': True},
'permissions': {},
'config_schema': [],
},
},
{
@@ -56,16 +52,12 @@ class FakeApplication:
'plugin_name': 'my-agent',
'runner_name': 'custom',
'manifest': {
'kind': 'AgentRunner',
'metadata': {
'name': 'custom',
'label': {'en_US': 'Custom Agent'},
},
'spec': {
'config': [{'name': 'param1', 'type': 'string'}],
'capabilities': {},
'permissions': {},
},
'id': 'plugin:alice/my-agent/custom',
'name': 'custom',
'label': {'en_US': 'Custom Agent'},
'capabilities': {},
'permissions': {},
'config_schema': [{'name': 'param1', 'type': 'string'}],
},
},
# Invalid runner - wrong kind
@@ -237,15 +229,12 @@ class TestRegistryMetadataForPipeline:
assert 'plugin:langbot/local-agent/default' in option_ids
assert 'plugin:alice/my-agent/custom' in option_ids
# Should fall back to manifest.spec.config when runtime does not return
# extracted config at top level.
# Config comes from the typed manifest.
assert len(stages) == 1
assert stages[0]['name'] == 'plugin:alice/my-agent/custom'
assert stages[0]['config'] == [{
'name': 'param1',
'type': 'string',
'id': 'plugin:alice/my-agent/custom.param1',
}]
assert stages[0]['config'][0]['name'] == 'param1'
assert stages[0]['config'][0]['type'] == 'string'
assert stages[0]['config'][0]['id'] == 'plugin:alice/my-agent/custom.param1'
class TestDescriptorValidation: