Skip to content

[DRAFT] Create Zenoh Transport Protocol#1296

Open
Kaweees wants to merge 2 commits intodevfrom
miguel/zenoh_transport
Open

[DRAFT] Create Zenoh Transport Protocol#1296
Kaweees wants to merge 2 commits intodevfrom
miguel/zenoh_transport

Conversation

@Kaweees
Copy link
Member

@Kaweees Kaweees commented Feb 19, 2026

This merge request implements Zenoh transport layer, providing a new high-performance pub/sub transport option.

Quick Start

Note

We currently use the python bindings for Eclipse Zenoh as our Zenoh implementation. Its IdlStruct feature lets you define DDS topic types in pure Python, eliminating the need for separate IDL files, with automatic serialization support.

import json
from dataclasses import dataclass, asdict
from dimos.protocol.pubsub.impl.zenohpubsub import ZenohPubSub, Topic

@dataclass
class SensorReading:
    value: float

zenoh = ZenohPubSub()
zenoh.start()

received = []
sensor_topic = Topic(name="sensors/temperature")

zenoh.subscribe(sensor_topic, lambda msg, t: received.append(SensorReading(**json.loads(msg))))
zenoh.publish(sensor_topic, json.dumps(asdict(SensorReading(value=22.5))))

import time
time.sleep(0.1)

print(f"Received: {received}")
zenoh.stop()
Received: [SensorReading(value=22.5)]

Unit Tests/Benchmarks

# Test and benchmark Zenoh transport protocol
uv run python -m pytest -svm tool dimos/protocol/pubsub/benchmark/test_benchmark.py --override-ini="addopts=" -k "Zenoh"
# Test and benchmark all transport protocols
uv run python -m pytest -svm tool dimos/protocol/pubsub/benchmark/test_benchmark.py
image

This builds off of #1144, which was closed due to having too many merge conflicts with dev and #1036, which was closed because the branch was renamed to miguel/dds_transport

@Kaweees Kaweees self-assigned this Feb 19, 2026
@greptile-apps
Copy link

greptile-apps bot commented Feb 19, 2026

Greptile Summary

Added eclipse-zenoh>=1.7.2 dependency to pyproject.toml under Transport Protocols section. This lays groundwork for implementing Zenoh transport protocol support in DimOS.

Key observations:

  • Dependency is properly placed in the Transport Protocols section alongside dimos-lcm and PyTurboJPEG
  • Uses minimum version constraint (>=1.7.2) which allows for forward compatibility
  • ZenohTransport stub class already exists in dimos/core/transport.py:322 (added in earlier commit) but contains no implementation yet
  • Documentation in docs/usage/transports.md currently lists LCM, SharedMemory, DDS, ROS, and Redis transports but doesn't mention Zenoh

Recommendations:

  • Implement the ZenohTransport class by adding broadcast() and subscribe() methods following the pattern of other transports
  • Create a corresponding zenohpubsub.py implementation in dimos/protocol/pubsub/impl/
  • Update transport documentation to include Zenoh alongside other available transports
  • Consider adding benchmark tests for Zenoh performance comparison

Confidence Score: 4/5

  • This PR is safe to merge - it only adds a dependency without modifying behavior
  • Single-line dependency addition is low-risk. Score of 4 (not 5) because implementation is incomplete - the ZenohTransport stub needs to be filled in before the dependency becomes functional
  • No files require special attention - this is a straightforward dependency addition

Important Files Changed

Filename Overview
pyproject.toml Added eclipse-zenoh>=1.7.2 dependency to support Zenoh transport protocol implementation

Last reviewed commit: e9b3f94

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

# Transport Protocols
"dimos-lcm",
"PyTurboJPEG==1.8.2",
"eclipse-zenoh>=1.7.2",
Copy link

Choose a reason for hiding this comment

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

Check that ZenohTransport implementation in dimos/core/transport.py:322 is complete - currently it's just an empty stub (class ZenohTransport(PubSubTransport[T]): ...)

# Transport Protocols
"dimos-lcm",
"PyTurboJPEG==1.8.2",
"eclipse-zenoh>=1.7.2",
Copy link

Choose a reason for hiding this comment

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

Check if docs/usage/transports.md should be updated to document Zenoh transport alongside LCM, SharedMemory, DDS, and ROS transports

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!

@spomichter
Copy link
Contributor

Where are you handling bridge vs host discovery mode? pretty importatnt for zenoh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments