fix(web): make Go2 teleop UIs LAN-aware#2377
Conversation
Greptile SummaryThis PR makes the Go2 teleop web UIs LAN-aware by replacing hardcoded
Confidence Score: 5/5Safe to merge — changes are additive, well-tested, and address previously identified issues around host binding and hardcoded URLs. All three change surfaces (dashboard URL generation, RobotWebInterface host forwarding, and uvicorn host sourcing) are covered by new focused tests. The JavaScript URL construction handles IPv6, protocol normalization, and query-param overrides correctly. No regressions to existing behaviour are expected since the default listen_host of 127.0.0.1 preserves the prior localhost-only binding. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant DashboardHTML as rerun_dashboard.html
participant DIMOS as DIMOS Server (WebsocketVisModule)
participant Rerun as Rerun Viewer (separate port)
Browser->>DashboardHTML: GET /dashboard
Note over DashboardHTML: Reads window.location.hostname<br/>+ query/config overrides
DashboardHTML->>Browser: "Sets commandCenter.src = origin + /command-center"
DashboardHTML->>Browser: "Sets rerun.src = rerunWebProtocol://rerunHost:rerunWebPort/?url=rerun+grpc://..."
Browser->>DIMOS: iframe GET /command-center (same origin)
Browser->>Rerun: iframe GET on resolved rerun URL
Note over DIMOS: Bound to GlobalConfig.listen_host<br/>(default 127.0.0.1, override 0.0.0.0 for LAN)
Reviews (4): Last reviewed commit: "test: avoid multipart dependency in web ..." | Re-trigger Greptile |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
c8c7309 to
24e11bc
Compare
|
Follow-up for the Codecov Local validation after the fix:
The new GitHub Actions runs for this fork PR are currently |
Summary
localhostor stale Rerun ports.GlobalConfig.listen_hostinto phone teleop, WebsocketVis, andRobotWebInterfaceserver construction.RobotWebInterface(host=...)handling.RobotWebInterfacehost test so it does not require optionalpython-multipartsupport in CI.Why
Phone and browser teleop must work from another device on the same trusted LAN. Hardcoded localhost URLs and loopback-only server binding make the UI appear broken even when the robot connection is healthy.
Safety
--listen-host 0.0.0.0; this PR does not silently expose motion-capable browser UIs.Validation
uv run pytest dimos/web/test_robot_web_interface.py dimos/web/templates/test_rerun_dashboard.py dimos/web/websocket_vis/test_websocket_vis_module.py dimos/teleop/phone/test_phone_teleop_module.py -quv run ruff check dimos/web/test_robot_web_interface.py dimos/web/robot_web_interface.py dimos/web/templates/test_rerun_dashboard.py dimos/web/websocket_vis/websocket_vis_module.py dimos/web/websocket_vis/test_websocket_vis_module.py dimos/teleop/phone/phone_teleop_module.py dimos/teleop/phone/test_phone_teleop_module.pyReview Notes
test_robot_web_interface_accepts_explicit_hostby avoiding full FastAPI route registration in a unit test whose purpose is only host forwarding.