Skip to content

feat(web): PR 4 - E2E#3045

Open
paul-nechifor wants to merge 1 commit into
paul/feat/web-3-python-clientfrom
paul/feat/web-4-e2e-packaging
Open

feat(web): PR 4 - E2E#3045
paul-nechifor wants to merge 1 commit into
paul/feat/web-3-python-clientfrom
paul/feat/web-4-e2e-packaging

Conversation

@paul-nechifor

Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds end-to-end support for the Deno relay. The main changes are:

  • Add relay process startup and shutdown management.
  • Add a manual relay smoke demo and E2E coverage.
  • Package relay sources in sdists and wheel builds.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
dimos/web/relay_bridge/demo_smoke.py Adds a manual smoke demo that starts clients and reports delivered relay frames.
dimos/web/relay_bridge/relay_process.py Adds relay subprocess startup, ready-line parsing, and cleanup.
dimos/web/relay_bridge/test_relay_e2e.py Adds end-to-end relay tests for delivery, resets, malformed frames, and shutdown.
setup.py Copies required relay runtime files into non-editable build outputs.
MANIFEST.in Includes relay source files in source distributions.

Reviews (2): Last reviewed commit: "feat(web): relay process management, e2e..." | Re-trigger Greptile

parser.add_argument("--secs", type=float, default=0, help="run time; 0 = until Ctrl-C")
args = parser.parse_args()

if args.url is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Viewer URL Misroutes Robot Connection

When --url receives the wtUrl exposed by /api/info, it ends in /viewer. RelayClient.connect(url, "robot") preserves that path, so the relay registers the supposed robot as a viewer and drops its data frames. The demo then reports no delivered odometry despite both connections succeeding.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +313 to +332
process = RelayProcess()
info = process.start()
robot = await RelayClient.connect(info.wt_url, "robot")
try:
await robot.hello()
writer = robot.latest_writer("cam")
writer.offer(b"x" * 1000)
await asyncio.sleep(0.1) # let the pump start
process.stop() # graceful shutdown sends CONNECTION_CLOSE

await asyncio.wait_for(robot.wait_closed(), timeout=10.0)
assert robot.is_closed
await asyncio.sleep(0.1) # let the pump observe the close
assert writer._task.done()
# A dead channel is visible at the producer.
with pytest.raises(RuntimeError):
writer.offer(b"y")
finally:
await robot.close()
process.stop()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Failed Connect Skips Relay Teardown

If this connection raises after process.start() succeeds, robot is never assigned. The finally block then raises while evaluating await robot.close() and never reaches process.stop(), leaving the Deno relay process alive and able to interfere with later tests.

Suggested change
process = RelayProcess()
info = process.start()
robot = await RelayClient.connect(info.wt_url, "robot")
try:
await robot.hello()
writer = robot.latest_writer("cam")
writer.offer(b"x" * 1000)
await asyncio.sleep(0.1) # let the pump start
process.stop() # graceful shutdown sends CONNECTION_CLOSE
await asyncio.wait_for(robot.wait_closed(), timeout=10.0)
assert robot.is_closed
await asyncio.sleep(0.1) # let the pump observe the close
assert writer._task.done()
# A dead channel is visible at the producer.
with pytest.raises(RuntimeError):
writer.offer(b"y")
finally:
await robot.close()
process.stop()
process = RelayProcess()
robot: RelayClient | None = None
try:
info = process.start()
robot = await RelayClient.connect(info.wt_url, "robot")
await robot.hello()
writer = robot.latest_writer("cam")
writer.offer(b"x" * 1000)
await asyncio.sleep(0.1) # let the pump start
process.stop() # graceful shutdown sends CONNECTION_CLOSE
await asyncio.wait_for(robot.wait_closed(), timeout=10.0)
assert robot.is_closed
await asyncio.sleep(0.1) # let the pump observe the close
assert writer._task.done()
# A dead channel is visible at the producer.
with pytest.raises(RuntimeError):
writer.offer(b"y")
finally:
try:
if robot is not None:
await robot.close()
finally:
process.stop()

@paul-nechifor paul-nechifor added the backport:skip Skip creating a backport to any release branches label Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.71429% with 26 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_process.py 80.20% 15 Missing and 4 partials ⚠️
dimos/web/relay_bridge/test_relay_e2e.py 96.19% 3 Missing and 4 partials ⚠️
@@                        Coverage Diff                        @@
##           paul/feat/web-3-python-client    #3045      +/-   ##
=================================================================
+ Coverage                          72.36%   72.53%   +0.17%     
=================================================================
  Files                               1030     1033       +3     
  Lines                              92720    93056     +336     
  Branches                            8491     8522      +31     
=================================================================
+ Hits                               67098    67501     +403     
+ Misses                             23344    23251      -93     
- Partials                            2278     2304      +26     
Flag Coverage Δ
OS-ubuntu-24.04-arm 65.66% <90.71%> (+0.20%) ⬆️
OS-ubuntu-latest 67.97% <90.71%> (+0.18%) ⬆️
Py-3.10 67.96% <90.71%> (+0.18%) ⬆️
Py-3.11 67.96% <90.71%> (+0.18%) ⬆️
Py-3.12 67.97% <90.71%> (+0.18%) ⬆️
Py-3.13 67.96% <90.71%> (+0.18%) ⬆️
Py-3.14 67.97% <90.71%> (+0.19%) ⬆️
Py-3.14t 67.97% <90.71%> (+0.19%) ⬆️
SelfHosted-Large 30.09% <20.71%> (-0.04%) ⬇️
SelfHosted-Linux 37.25% <20.71%> (-0.07%) ⬇️
SelfHosted-macOS 36.13% <20.71%> (-0.07%) ⬇️

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

Files with missing lines Coverage Δ
dimos/web/relay_bridge/test_relay_e2e.py 96.19% <96.19%> (ø)
dimos/web/relay_bridge/relay_process.py 80.20% <80.20%> (ø)

... and 6 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.

Split 4/4 of the web project setup: RelayProcess child management,
demo_smoke, Python<->relay e2e test, and _relay_dist wheel bundling
(setup.py + MANIFEST.in). Stacked on paul/feat/web-3-python-client.
@paul-nechifor
paul-nechifor force-pushed the paul/feat/web-3-python-client branch from fe724ae to a7cf9ae Compare July 18, 2026 22:17
@paul-nechifor
paul-nechifor force-pushed the paul/feat/web-4-e2e-packaging branch from 188bc50 to aef5a79 Compare July 18, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip Skip creating a backport to any release branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant