@@ -49,9 +49,10 @@ async fn test_exec_stdout_stream_events_echo() {
49
49
"printf 'hello-world\n '" . to_string( ) ,
50
50
] ;
51
51
52
+ let cwd = std:: env:: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ;
52
53
let params = ExecParams {
53
54
command : cmd,
54
- cwd : std :: env :: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ,
55
+ cwd : cwd . clone ( ) ,
55
56
timeout_ms : Some ( 5_000 ) ,
56
57
env : HashMap :: new ( ) ,
57
58
with_escalated_permissions : None ,
@@ -64,6 +65,7 @@ async fn test_exec_stdout_stream_events_echo() {
64
65
params,
65
66
SandboxType :: None ,
66
67
& policy,
68
+ cwd. as_path ( ) ,
67
69
& None ,
68
70
Some ( stdout_stream) ,
69
71
)
@@ -99,9 +101,10 @@ async fn test_exec_stderr_stream_events_echo() {
99
101
"printf 'oops\n ' 1>&2" . to_string( ) ,
100
102
] ;
101
103
104
+ let cwd = std:: env:: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ;
102
105
let params = ExecParams {
103
106
command : cmd,
104
- cwd : std :: env :: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ,
107
+ cwd : cwd . clone ( ) ,
105
108
timeout_ms : Some ( 5_000 ) ,
106
109
env : HashMap :: new ( ) ,
107
110
with_escalated_permissions : None ,
@@ -114,6 +117,7 @@ async fn test_exec_stderr_stream_events_echo() {
114
117
params,
115
118
SandboxType :: None ,
116
119
& policy,
120
+ cwd. as_path ( ) ,
117
121
& None ,
118
122
Some ( stdout_stream) ,
119
123
)
@@ -152,9 +156,10 @@ async fn test_aggregated_output_interleaves_in_order() {
152
156
"printf 'O1\\ n'; sleep 0.01; printf 'E1\\ n' 1>&2; sleep 0.01; printf 'O2\\ n'; sleep 0.01; printf 'E2\\ n' 1>&2" . to_string( ) ,
153
157
] ;
154
158
159
+ let cwd = std:: env:: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ;
155
160
let params = ExecParams {
156
161
command : cmd,
157
- cwd : std :: env :: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ,
162
+ cwd : cwd . clone ( ) ,
158
163
timeout_ms : Some ( 5_000 ) ,
159
164
env : HashMap :: new ( ) ,
160
165
with_escalated_permissions : None ,
@@ -163,9 +168,16 @@ async fn test_aggregated_output_interleaves_in_order() {
163
168
164
169
let policy = SandboxPolicy :: new_read_only_policy ( ) ;
165
170
166
- let result = process_exec_tool_call ( params, SandboxType :: None , & policy, & None , None )
167
- . await
168
- . expect ( "process_exec_tool_call" ) ;
171
+ let result = process_exec_tool_call (
172
+ params,
173
+ SandboxType :: None ,
174
+ & policy,
175
+ cwd. as_path ( ) ,
176
+ & None ,
177
+ None ,
178
+ )
179
+ . await
180
+ . expect ( "process_exec_tool_call" ) ;
169
181
170
182
assert_eq ! ( result. exit_code, 0 ) ;
171
183
assert_eq ! ( result. stdout. text, "O1\n O2\n " ) ;
@@ -182,9 +194,10 @@ async fn test_exec_timeout_returns_partial_output() {
182
194
"printf 'before\\ n'; sleep 2; printf 'after\\ n'" . to_string( ) ,
183
195
] ;
184
196
197
+ let cwd = std:: env:: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ;
185
198
let params = ExecParams {
186
199
command : cmd,
187
- cwd : std :: env :: current_dir ( ) . unwrap_or_else ( |_| PathBuf :: from ( "." ) ) ,
200
+ cwd : cwd . clone ( ) ,
188
201
timeout_ms : Some ( 200 ) ,
189
202
env : HashMap :: new ( ) ,
190
203
with_escalated_permissions : None ,
@@ -193,7 +206,15 @@ async fn test_exec_timeout_returns_partial_output() {
193
206
194
207
let policy = SandboxPolicy :: new_read_only_policy ( ) ;
195
208
196
- let result = process_exec_tool_call ( params, SandboxType :: None , & policy, & None , None ) . await ;
209
+ let result = process_exec_tool_call (
210
+ params,
211
+ SandboxType :: None ,
212
+ & policy,
213
+ cwd. as_path ( ) ,
214
+ & None ,
215
+ None ,
216
+ )
217
+ . await ;
197
218
198
219
let Err ( CodexErr :: Sandbox ( SandboxErr :: Timeout { output } ) ) = result else {
199
220
panic ! ( "expected timeout error" ) ;
0 commit comments