Skip to content

Conversation

@leshy
Copy link
Contributor

@leshy leshy commented Jan 29, 2026

Sketch level rerun-bridge implementation on top of * subs

  • This is a sketch, ready for someone to make mature/prod ready.
  • Add RerunBridgeModule that subscribes to all pubsub topics and logs messages with to_rerun() methods to Rerun viewer
  • Add rerun-bridge CLI command for quick visualization

Features

  • Automatic discovery of messages with to_rerun() methods
  • Configurable viewer mode (native, web, none)
  • Works with any pubsub that supports subscribe_all()

Testing

totally external bridge

uv sync
dimos --viewer-backend none --replay run unitree-go2
rerun-bridge

or

bridge as a module

dimos --viewer-backend none --replay run unitree-go2-bridge

#1171

WIP

needs global config sorted (discussing with paul) then good to go

- Add RerunBridgeModule that subscribes to all LCM messages and logs
  those with to_rerun() methods to Rerun viewer
- Add SubscribeAllCapable protocol to pubsub spec for type-safe
  subscribe_all support
- Add rerun-bridge CLI tool with --viewer-mode native|web|none
- Add "none" option to ViewerBackend for headless operation
- Add unitree_go2_bridge blueprint variant
@leshy leshy changed the title feat: add RerunBridge module for visualizing pubsub messages feat: add RerunBridge module and CLI Jan 29, 2026
@greptile-apps
Copy link

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

This PR introduces a RerunBridgeModule that enables visualization of pubsub messages by automatically logging any message with a to_rerun() method to a Rerun viewer. The implementation adds support for subscribing to all topics on pubsubs that implement the new SubscribeAllCapable protocol.

Key changes:

  • Added SubscribeAllCapable protocol to dimos/protocol/pubsub/spec.py with covariant type variables for proper type safety
  • Implemented RerunBridgeModule in dimos/visualization/rerun/bridge.py with configurable viewer modes (native, web, none)
  • Added CLI command rerun-bridge for quick visualization
  • Extended ViewerBackend type to include "none" option for headless operation
  • Integrated bridge into unitree_go2_bridge blueprint

Issues found:

  • Critical: Line 115 in bridge.py incorrectly passes pubsub.stop to Disposable() without wrapping in lambda, preventing proper cleanup
  • Critical: Line 139 uses signal.pause() which is Unix-only and will crash on Windows

The architectural approach is sound - the protocol-based abstraction allows any pubsub implementing subscribe_all() to work with the bridge, and the automatic discovery of to_rerun() methods provides a clean interface. However, the two critical bugs must be fixed before merging.

Confidence Score: 3/5

  • This PR has critical bugs that will cause runtime failures and should be fixed before merging.
  • Two critical bugs in the bridge module: incorrect disposable wrapping that won't properly call stop methods, and Unix-only signal.pause() that will crash on Windows. The rest of the changes are solid.
  • Pay close attention to dimos/visualization/rerun/bridge.py - it has two critical bugs on lines 115 and 139 that must be fixed.

Important Files Changed

Filename Overview
dimos/visualization/rerun/bridge.py New RerunBridgeModule added for visualizing pubsub messages. Has critical bugs in disposable handling and cross-platform signal handling.
dimos/protocol/pubsub/spec.py Added SubscribeAllCapable protocol with proper covariant type variables for type safety.
dimos/core/global_config.py Added "none" option to ViewerBackend type alias for headless operation.

Sequence Diagram

sequenceDiagram
    participant CLI as rerun-bridge CLI
    participant Bridge as RerunBridgeModule
    participant RR as Rerun Viewer
    participant PS as PubSub (LCM)
    participant Msg as Message with to_rerun()

    CLI->>Bridge: start()
    Bridge->>RR: rr.init("dimos-bridge")
    Bridge->>RR: rr.spawn() / rr.serve_web_viewer()
    Bridge->>PS: start()
    Bridge->>PS: subscribe_all(callback=_on_message)
    PS-->>Bridge: unsub function
    
    loop On each message
        PS->>Bridge: _on_message(msg, topic)
        alt msg has to_rerun()
            Bridge->>Msg: to_rerun()
            Msg-->>Bridge: rerun_data
            alt rerun_data is list
                loop for each (entity_path, archetype)
                    Bridge->>RR: rr.log(entity_path, archetype)
                end
            else single archetype
                Bridge->>Bridge: _get_entity_path(topic)
                Bridge->>RR: rr.log(entity_path, rerun_data)
            end
        end
    end
    
    CLI->>Bridge: stop() (on SIGINT)
    Bridge->>PS: unsub()
    Bridge->>PS: stop()
Loading

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.

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@linear linear bot mentioned this pull request Feb 3, 2026
@leshy leshy changed the title feat: add RerunBridge module and CLI WIP: add RerunBridge module and CLI Feb 3, 2026
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