mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-26 23:44:19 +00:00
refactor(agent-runner): use sandbox file model
This commit is contained in:
@@ -19,9 +19,7 @@ FULL_PERMISSIONS = {
|
||||
'knowledge_bases': ['list', 'retrieve'],
|
||||
'history': ['page', 'search'],
|
||||
'events': ['get', 'page'],
|
||||
'artifacts': ['metadata', 'read'],
|
||||
'storage': ['plugin', 'workspace'],
|
||||
'files': ['config', 'knowledge'],
|
||||
}
|
||||
|
||||
|
||||
@@ -384,42 +382,6 @@ async def test_build_knowledge_bases_manifest_permission_denies_binding_kbs(app)
|
||||
assert resources['knowledge_bases'] == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_build_files_authorizes_config_declared_file_fields(app):
|
||||
descriptor = make_descriptor(
|
||||
config_schema=[
|
||||
{'name': 'avatar', 'type': 'file'},
|
||||
{'name': 'references', 'type': 'array[file]'},
|
||||
],
|
||||
)
|
||||
query = make_query({
|
||||
'avatar': {'file_key': 'plugin_config_avatar.png', 'mimetype': 'image/png'},
|
||||
'references': [
|
||||
{'file_key': 'plugin_config_doc.txt', 'mimetype': 'text/plain', 'file_name': 'doc.txt'},
|
||||
{'file_key': 'plugin_config_doc.txt', 'mimetype': 'text/plain', 'file_name': 'doc.txt'},
|
||||
],
|
||||
})
|
||||
|
||||
resources = await build_resources(app, query, descriptor)
|
||||
|
||||
assert resources['files'] == [
|
||||
{
|
||||
'file_id': 'plugin_config_avatar.png',
|
||||
'file_name': None,
|
||||
'mime_type': 'image/png',
|
||||
'source': 'config',
|
||||
'operations': ['config'],
|
||||
},
|
||||
{
|
||||
'file_id': 'plugin_config_doc.txt',
|
||||
'file_name': 'doc.txt',
|
||||
'mime_type': 'text/plain',
|
||||
'source': 'config',
|
||||
'operations': ['config'],
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_build_storage_intersects_manifest_and_binding_policy(app):
|
||||
descriptor = make_descriptor(
|
||||
|
||||
Reference in New Issue
Block a user