Skip to content

feat: local relay - #3068

Merged
paul-nechifor merged 3 commits into
mainfrom
paul/feat/t2-relay
Jul 27, 2026
Merged

feat: local relay#3068
paul-nechifor merged 3 commits into
mainfrom
paul/feat/t2-relay

Conversation

@paul-nechifor

@paul-nechifor paul-nechifor commented Jul 20, 2026

Copy link
Copy Markdown
Contributor
  • Use --local-relay to spawn a local relay.
  • New messages which carry robot id, channel manifest, etc.
  • Split server.ts into smaller files.
  • Added RelayBridgeModule.
  • dimos run automatically adds RelayBridgeModule if --local-relay is specified.

How to Test

Run:

uv run python -m dimos.web.relay_bridge.demo_smoke

Go to http://127.0.0.1:45175/debug.html .


Run sim:

uv run dimos --simulation run --local-relay unitree-go2

Go to http://127.0.0.1:7780/debug.html


Closes DIM-1164

@paul-nechifor
paul-nechifor marked this pull request as draft July 20, 2026 16:11
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a local relay for robot telemetry and viewer connections. The main changes are:

  • Adds relay bridge configuration and CLI options.
  • Starts a local relay when requested by dimos run.
  • Adds robot manifests, viewer subscriptions, and relay session handling.
  • Splits relay server responsibilities into registry and session modules.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
web/relay/registry.ts Adds robot registration, viewer subscription tracking, and frame routing.
web/relay/session.ts Adds WebTransport robot and viewer session handling.
web/relay/server.ts Wires relay listeners to the extracted registry and session components.
dimos/robot/cli/dimos.py Adds relay CLI settings and injects the relay bridge module into enabled runs.

Reviews (6): Last reviewed commit: "fix(tests): scope the relay-kill e2e tes..." | Re-trigger Greptile

Comment thread web/relay/registry.ts
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.66587% with 80 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/web/relay_bridge/relay_bridge_module.py 92.49% 17 Missing and 5 partials ⚠️
dimos/web/relay_bridge/e2e_support.py 76.00% 8 Missing and 4 partials ⚠️
dimos/web/relay_bridge/relay_process.py 56.52% 8 Missing and 2 partials ⚠️
dimos/robot/cli/dimos.py 47.05% 7 Missing and 2 partials ⚠️
dimos/web/relay_bridge/test_relay_bridge_module.py 98.18% 5 Missing and 3 partials ⚠️
dimos/web/relay_bridge/test_relay_bridge_e2e.py 95.68% 3 Missing and 3 partials ⚠️
dimos/memory2/codecs/test_codecs.py 81.25% 2 Missing and 1 partial ⚠️
dimos/web/relay_bridge/_wt_session.py 57.14% 2 Missing and 1 partial ⚠️
dimos/web/relay_bridge/test_relay_e2e.py 94.54% 1 Missing and 2 partials ⚠️
dimos/web/relay_bridge/wt_client.py 92.85% 2 Missing and 1 partial ⚠️
... and 1 more
@@            Coverage Diff             @@
##             main    #3068      +/-   ##
==========================================
+ Coverage   74.09%   74.33%   +0.24%     
==========================================
  Files        1103     1108       +5     
  Lines      104077   105309    +1232     
  Branches     9520     9598      +78     
==========================================
+ Hits        77114    78283    +1169     
- Misses      24270    24316      +46     
- Partials     2693     2710      +17     
Flag Coverage Δ
OS-ubuntu-24.04-arm 68.30% <93.34%> (+0.32%) ⬆️
OS-ubuntu-latest 70.34% <93.34%> (+0.29%) ⬆️
Py-3.10 70.33% <93.34%> (+0.29%) ⬆️
Py-3.11 70.33% <93.34%> (+0.29%) ⬆️
Py-3.12 70.32% <93.34%> (+0.28%) ⬆️
Py-3.13 70.33% <93.34%> (+0.29%) ⬆️
Py-3.14 70.34% <93.34%> (+0.30%) ⬆️
Py-3.14t 70.33% <93.34%> (+0.29%) ⬆️
SelfHosted-Large 29.32% <24.62%> (-0.33%) ⬇️
SelfHosted-Linux 35.95% <24.14%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/core/global_config.py 83.33% <100.00%> (+0.37%) ⬆️
dimos/robot/all_blueprints.py 100.00% <ø> (ø)
dimos/robot/cli/test_dimos.py 100.00% <100.00%> (ø)
dimos/web/relay_bridge/protocol.py 100.00% <100.00%> (ø)
dimos/web/relay_bridge/test_protocol.py 100.00% <100.00%> (ø)
dimos/web/relay_bridge/test_wt_client.py 97.53% <100.00%> (+2.40%) ⬆️
dimos/visualization/vis_module.py 75.00% <66.66%> (+1.08%) ⬆️
dimos/memory2/codecs/test_codecs.py 78.64% <81.25%> (-9.14%) ⬇️
dimos/web/relay_bridge/_wt_session.py 81.88% <57.14%> (+2.72%) ⬆️
dimos/web/relay_bridge/test_relay_e2e.py 96.58% <94.54%> (+0.67%) ⬆️
... and 7 more

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paul-nechifor
paul-nechifor force-pushed the paul/feat/web-4-e2e-packaging branch from aef5a79 to c412753 Compare July 23, 2026 12:07
@paul-nechifor
paul-nechifor force-pushed the paul/feat/web-4-e2e-packaging branch 2 times, most recently from da42793 to 3994661 Compare July 24, 2026 03:18
@paul-nechifor
paul-nechifor force-pushed the paul/feat/t2-relay branch 2 times, most recently from fb898c9 to efb16dc Compare July 24, 2026 12:15
@paul-nechifor
paul-nechifor force-pushed the paul/feat/web-4-e2e-packaging branch from 3994661 to 4b1a0ae Compare July 24, 2026 20:23
Base automatically changed from paul/feat/web-4-e2e-packaging to main July 24, 2026 21:14
@paul-nechifor
paul-nechifor force-pushed the paul/feat/t2-relay branch 2 times, most recently from 31cc330 to d596a73 Compare July 26, 2026 02:03
@paul-nechifor paul-nechifor changed the title WIP: Paul/feat/t2 relay feat: local relay Jul 26, 2026
@paul-nechifor
paul-nechifor marked this pull request as ready for review July 26, 2026 02:23
Installing libturbojpeg on the regular CI runners (for the relay bridge
tests) armed the previously-dormant jpeg case in test_codecs.py: with
the native lib present, _jpeg_case() no longer bailed out early and
downloaded go2_short.db (84 MB) from LFS at collection time, which the
git-lfs-guard on regular runners blocks, failing collection.

Resolve the cases at test time through an indirect fixture instead, and
mark the jpeg case self_hosted so the download only happens where big
LFS pulls are allowed (self-hosted runners and local machines). The
cheap turbojpeg availability probe stays at collection time so the case
is still silently absent (not a skip) where turbojpeg is missing,
matching the old behavior under --error-for-skips.
test_relay_child_death_respawns_and_recovers kills the shared
module-scoped bridge's relay child; the respawned child's pipe-reader
threads are created mid-test and legitimately live until module
teardown, so the per-test thread-leak monitor flags them. This mostly
went unnoticed because the monitor keys on thread idents and the new
readers usually recycle the just-joined old readers' idents, dodging
the check by luck; when scheduling breaks the reuse (seen on the arm64
CI runner) the test errors at teardown.

Give the destructive test its own function-scoped bridge so the
respawned child dies inside the test scope, and move the stop_module
helper (Module.stop + executor reap) into e2e_support for both test
files to share.
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 26, 2026
@paul-nechifor
paul-nechifor enabled auto-merge July 27, 2026 09:49
@paul-nechifor
paul-nechifor added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit abf5152 Jul 27, 2026
35 of 36 checks passed
@paul-nechifor
paul-nechifor deleted the paul/feat/t2-relay branch July 27, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Required CI checks have passed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants