@@ -81,20 +81,25 @@ def __init__(self, repo_url: str, git_token: str, sha: str, timeout: int, versio
8181 )
8282 url_parts = repo_url .split ("://" )
8383 lsproxy_image = modal .Image .from_registry (f"agenticlabs/lsproxy:{ version } " )
84- lsproxy_image = lsproxy_image .run_commands (
85- [
86- "git config --global --add safe.directory /mnt/workspace" ,
87- f"git clone --depth 1 { url_parts [0 ]} ://x-access-token:$GITHUB_IAT@{ url_parts [1 ]} /mnt/workspace"
88- ],
89- secrets = [
90- gh_secret
91- ], # sneaky, cache the layers (for the same sha) even as the token changes!
92- )
9384 if sha :
94- lsproxy_image = lsproxy_image .run_commands ([
95- f"cd /mnt/workspace && git fetch origin { sha } " ,
96- f"cd /mnt/workspace && git checkout { sha } "
97- ]
85+ lsproxy_image = lsproxy_image .run_commands (
86+ [
87+ "git config --global --add safe.directory /mnt/workspace" ,
88+ f"git clone --depth 1 { url_parts [0 ]} ://x-access-token:$GITHUB_IAT@{ url_parts [1 ]} /mnt/workspace && cd /mnt/workspace && git fetch origin { sha } && git checkout { sha } " ,
89+ ],
90+ secrets = [
91+ gh_secret
92+ ], # sneaky, cache the layers (for the same sha) even as the token changes!
93+ )
94+ else :
95+ lsproxy_image = lsproxy_image .run_commands (
96+ [
97+ "git config --global --add safe.directory /mnt/workspace" ,
98+ f"git clone --depth 1 { url_parts [0 ]} ://x-access-token:$GITHUB_IAT@{ url_parts [1 ]} /mnt/workspace"
99+ ],
100+ secrets = [
101+ gh_secret
102+ ], # sneaky, cache the layers (for the same sha) even as the token changes!
98103 )
99104 else :
100105 lsproxy_image = modal .Image .from_registry (f"agenticlabs/lsproxy:{ version } " ).run_commands (
@@ -116,9 +121,8 @@ def __init__(self, repo_url: str, git_token: str, sha: str, timeout: int, versio
116121
117122 print ("Starting sandbox..." )
118123
119- with modal .enable_output ():
120- self .sandbox = modal .Sandbox .create (** sandbox_config )
121- self .tunnel_url = self .sandbox .tunnels ()[4444 ].url
124+ self .sandbox = modal .Sandbox .create (** sandbox_config )
125+ self .tunnel_url = self .sandbox .tunnels ()[4444 ].url
122126
123127 # Start lsproxy
124128 p = self .sandbox .exec (f"lsproxy" )
0 commit comments