refactor(provider): formalize tool lookup contract

This commit is contained in:
huanghuoguoguo
2026-06-06 15:02:47 +08:00
parent cb33bf3260
commit edadff8971
6 changed files with 78 additions and 17 deletions
@@ -265,7 +265,7 @@ class TestToolManagerExecuteFuncCall:
@pytest.mark.asyncio
async def test_execute_raises_when_tool_not_found(self, mock_app_with_loaders, sample_query):
"""Test that execute_func_call raises ValueError when tool not found."""
"""Test that execute_func_call raises ToolNotFoundError when tool not found."""
toolmgr = get_toolmgr_module()
mock_app, mock_plugin_loader, mock_mcp_loader = mock_app_with_loaders
@@ -275,7 +275,7 @@ class TestToolManagerExecuteFuncCall:
manager = toolmgr.ToolManager(mock_app)
self._wire_loaders(manager, mock_app, mock_plugin_loader, mock_mcp_loader)
with pytest.raises(ValueError, match='未找到工具'):
with pytest.raises(toolmgr.ToolNotFoundError, match='Tool not found: unknown_tool'):
await manager.execute_func_call('unknown_tool', {}, sample_query)
@pytest.mark.asyncio