feat: --record taps every published topic into a memory store - #3710
feat: --record taps every published topic into a memory store#3710spomichter wants to merge 21 commits into
Conversation
- GlobalConfig.record ('' | sqlite) and record_topics (comma globs, default *).
Bare --record means sqlite (argv normalize, same as --simulation).
- Out.publish appends to recordings/<run-id>/memory-<pid>.db per process
(dimos/memory/tap.py); off unless --record, off in replay.
- Go2Memory / unitree-go2-memory removed: unitree-go2 --record replaces them.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3710 +/- ##
==========================================
- Coverage 77.54% 77.51% -0.04%
==========================================
Files 1304 1306 +2
Lines 123668 124061 +393
Branches 10821 10894 +73
==========================================
+ Hits 95902 96161 +259
- Misses 24976 25133 +157
+ Partials 2790 2767 -23
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
… process Replaces the per-process Out.publish hook: dimos run subscribes to every topic on the active transport (same backend selection as the Rerun bridge) and appends to recordings/<run-id>/memory.db.
…y --record and the Rerun bridge
Greptile SummaryThis change adds opt-in recording of matching transport streams to a per-run SQLite store, including command-line configuration and background persistence so transport callbacks can return promptly. Recording failures can prevent a run from exiting cleanly. If encoding or a SQLite append raises, the writer stops; once its queue fills, shutdown waits indefinitely while trying to enqueue the stop marker. Confidence Score: 4/5Not safe to merge until recorder shutdown remains reliable after a write failure. An exception while persisting a recorded message can leave the background writer stopped and block process cleanup indefinitely. Files Needing Attention: dimos/memory/tap.py
What T-Rex did
|
…, not a bus guess - ModuleCoordinator.transports exposes the wired (name, type) -> Transport table. - recording(coordinator.transports) subscribes each stream on whatever carries it (LCM, Zenoh, SHM, ...); streams are named by their blueprint name. - transport_factory / rerun bridge back to main (pubsub_backend dropped).
…queue (drops counted)
There was a problem hiding this comment.
two things
- delete
Subscribableimport Transport: [one click fix] - add a throttled warning for dropping messages: [one click fix]
Co-authored-by: Paul Nechifor <paul@nechifor.net>
…classes Transport; test_normalize_argv typed
|
@greptile final review |
…lose() can't deadlock
…lash and spaces in globs
Summary
Right now to record to memory requires Go2Module, need to specific and route IN topics. Prefer to simple to have some
--record mcapor--record --record-topics={color_image, ...}to specify full recordingTaps into coordinator loop and streams on a single worker to memory Sqlite store. Will add mcap support in next PR
After short recording:
You run:
uv run dimos --record --simulation run unitree-go2After run:
--record usage
Slop:
dimos --record run <blueprint>records every topic on the transport bus, rosbag-style, to onerecordings/<run-id>/memory.db(same run id aslogs/). No recorder module to wire per robot.GlobalConfig.record(""|sqlite) andrecord_topics(comma globs on the topic slug, default*). Bare--recordmeanssqlite, normalized in argv like--simulation(normalize_argv, one table entry per optional-value flag).mcapis the next value once the writer lands (follow-up PR).dimos/memory/tap.py:dimos runwrapscoordinator.loop()inrecording(), which subscribes to all topics on the active transport's pubsub (same backend selection as the Rerun bridge: LCM, or Zenoh when--transport zenoh) and appends each decoded message under its topic slug (/lidar->lidar). Single writer, single file. Off unless--record; off under--replay. Topics without a dimos message type are skipped.tfis a topic like any other anddimos map pose-fillderives poses on read.Recordermodules (Go2Memory/unitree-go2-memory,unitree-go2-mid360-record,unitree-g1-record, ...) are unchanged: recording specific topics as a module stays available alongside--record.Caveats: SHM-only streams are not on the bus and are not recorded; Zenoh's
subscribe_allis latest-per-topic (best effort), LCM is complete.