mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-23 04:46:07 +00:00
refactor(agent-runner): use sandbox file model
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user