@@ -105,8 +105,10 @@ async def _get_script_project_impl(
105105 """Internal implementation for get_script_project."""
106106 logger .info (f"[get_script_project] Email: { user_google_email } , ID: { script_id } " )
107107
108- project = await asyncio .to_thread (
109- service .projects ().get (scriptId = script_id ).execute
108+ # Get project metadata and content concurrently (independent requests)
109+ project , content = await asyncio .gather (
110+ asyncio .to_thread (service .projects ().get (scriptId = script_id ).execute ),
111+ asyncio .to_thread (service .projects ().getContent (scriptId = script_id ).execute ),
110112 )
111113
112114 title = project .get ("title" , "Untitled" )
@@ -124,7 +126,7 @@ async def _get_script_project_impl(
124126 "Files:" ,
125127 ]
126128
127- files = project .get ("files" , [])
129+ files = content .get ("files" , [])
128130 for i , file in enumerate (files , 1 ):
129131 file_name = file .get ("name" , "Untitled" )
130132 file_type = file .get ("type" , "Unknown" )
@@ -172,11 +174,12 @@ async def _get_script_content_impl(
172174 f"[get_script_content] Email: { user_google_email } , ID: { script_id } , File: { file_name } "
173175 )
174176
175- project = await asyncio .to_thread (
176- service .projects ().get (scriptId = script_id ).execute
177+ # Must use getContent() to retrieve files, not get() which only returns metadata
178+ content = await asyncio .to_thread (
179+ service .projects ().getContent (scriptId = script_id ).execute
177180 )
178181
179- files = project .get ("files" , [])
182+ files = content .get ("files" , [])
180183 target_file = None
181184
182185 for file in files :
0 commit comments