diff --git a/client/tests/atlas_agent_driver.gd b/client/tests/atlas_agent_driver.gd index 8b1225e06..50e3386f6 100644 --- a/client/tests/atlas_agent_driver.gd +++ b/client/tests/atlas_agent_driver.gd @@ -99,6 +99,25 @@ func _run() -> void: quit(1) return + # SR_PORT wiring (PR #209 eyeball finding) — mirror visual_capture.gd's + # live-mode convention exactly: every sibling real-render driver + # (visual_capture, atlas_standalone, locomotion_sandbox) reads SR_PORT + # rather than silently relying on SimBridge's hardcoded default port; + # without this, a caller who started the server on a chosen port (the + # run-visual --port pattern) gets 20 silent connect retries against the + # wrong port and a hollow session whose act() results still have valid + # SHAPES but no data behind them. SR_LIVE=1 without SR_PORT is a hard + # error, same as visual_capture.gd. + if OS.get_environment("SR_LIVE") == "1": + var port_env := OS.get_environment("SR_PORT") + if port_env.is_empty(): + push_error("atlas_agent_driver: SR_LIVE=1 but SR_PORT not set") + quit(1) + return + var sim_bridge := root.get_node("/root/SimBridge") + sim_bridge.server_port = int(port_env) + print("atlas_agent_driver: live mode — server port %d" % sim_bridge.server_port) + var main_scene = load("res://scenes/main.tscn") var main_node = main_scene.instantiate()