@@ -245,9 +245,9 @@ def test_env_overrides_sandbox_toml(monkeypatch, default_config, temp_toml_file)
245
245
workspace_base = "/opt/files3/workspace"
246
246
247
247
[sandbox]
248
- sandbox_type = "e2b"
249
- sandbox_timeout = 500
250
- sandbox_user_id = 1001
248
+ box_type = "e2b"
249
+ timeout = 500
250
+ user_id = 1001
251
251
""" )
252
252
253
253
monkeypatch .setenv ('LLM_API_KEY' , 'env-api-key' )
@@ -283,6 +283,36 @@ def test_env_overrides_sandbox_toml(monkeypatch, default_config, temp_toml_file)
283
283
assert default_config .workspace_mount_path == os .getcwd () + '/UNDEFINED'
284
284
285
285
286
+ def test_sandbox_config_from_toml (default_config , temp_toml_file ):
287
+ # Test loading configuration from a new-style TOML file
288
+ with open (temp_toml_file , 'w' , encoding = 'utf-8' ) as toml_file :
289
+ toml_file .write (
290
+ """
291
+ [core]
292
+ workspace_base = "/opt/files/workspace"
293
+
294
+ [llm]
295
+ model = "test-model"
296
+
297
+ [sandbox]
298
+ box_type = "local"
299
+ timeout = 1
300
+ container_image = "custom_image"
301
+ user_id = 1001
302
+ """
303
+ )
304
+
305
+ load_from_toml (default_config , temp_toml_file )
306
+ load_from_env (default_config , os .environ )
307
+ finalize_config (default_config )
308
+
309
+ assert default_config .llm .model == 'test-model'
310
+ assert default_config .sandbox .box_type == 'local'
311
+ assert default_config .sandbox .timeout == 1
312
+ assert default_config .sandbox .container_image == 'custom_image'
313
+ assert default_config .sandbox .user_id == 1001
314
+
315
+
286
316
def test_defaults_dict_after_updates (default_config ):
287
317
# Test that `defaults_dict` retains initial values after updates.
288
318
initial_defaults = default_config .defaults_dict
0 commit comments