feat(go2): add read-only local Wi-Fi diagnostics#2378
Conversation
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is entirely additive (new CLI sub-command + tests), sends no robot commands, and all execution paths terminate cleanly. All three files are new additions with no modifications to existing logic. The diagnostics are read-only, the two-tier TCP listener fallback is well-guarded, and the runtime-evidence adjustment is straightforward. The one cosmetic message inaccuracy does not affect correctness or safety. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as go2tool doctor (CLI)
participant CR as collect_report
participant RB as check_robot
participant LD as LAN discover
participant SP as signal probe (HTTP)
participant IF as local_interfaces
participant RN as check_run
participant CP as check_ports
participant PU as psutil.net_connections
participant LO as lsof fallback
participant IM as check_image
participant PS as pubsub subscribe
participant AD as _adjust_robot_check
CLI->>CR: collect_report(robot_ip, ...)
CR->>RB: check_robot(robot_ip)
RB->>LD: discover(timeout)
LD-->>RB: "[]|[Go2Device]"
RB->>SP: GET /con_notify
SP-->>RB: "ok|timeout"
RB-->>CR: RobotCheck
CR->>IF: local_interfaces(resolved_robot_ip)
IF-->>CR: [LocalInterface]
CR->>RN: check_run()
RN-->>CR: RunCheck
CR->>CP: check_ports(endpoints, probe_hosts)
CP->>PU: "net_connections(kind=tcp)"
PU-->>CP: connections
alt required port missing
CP->>LO: _lsof_tcp_listeners()
LO-->>CP: "{port: [hosts]}"
end
CP-->>CR: [PortCheck]
CR->>IM: check_image(topics, timeout)
IM->>PS: subscribe_pubsub_uri(topic, cb)
PS-->>IM: "frame | timeout"
IM-->>CR: ImageCheck
CR->>AD: _adjust_robot_check_with_runtime_evidence
AD-->>CR: RobotCheck (possibly FAIL to WARN)
CR-->>CLI: Go2DoctorReport
CLI->>CLI: format_report / json.dumps
Reviews (3): Last reviewed commit: "Address Go2 doctor review comments" | Re-trigger Greptile |
|
Follow-up stack for turning this doctor into startup automation:
I kept these as draft stacked PRs in the fork because I do not have permission to push upstream stack base branches to |
Summary
dimos go2tool doctorfor read-only Go2 local Wi-Fi teleop diagnostics.color_imagereceipt.Why
Go2 local Wi-Fi failures often look the same from the browser: stale robot IPs, stale operator-machine IPs, loopback-only listeners, missing video, and dead WebRTC sessions all produce blank or unreachable UI states. The doctor gives operators a no-motion way to identify which layer is actually broken.
Safety
Validation
uv run pytest dimos/robot/unitree/go2/cli/test_doctor.py -quv run ruff check dimos/robot/unitree/go2/cli/go2tool.py dimos/robot/unitree/go2/cli/doctor.py dimos/robot/unitree/go2/cli/test_doctor.pydimos go2tool doctor --robot-ip <go2_ip> --no-discover --connect-timeout 0.8 --check-image --image-timeout 1.0against a runningteleop-phone-go2stack.No robot motion commands were sent during validation.