Skip to content

small fixes for release#2019

Open
paul-nechifor wants to merge 1 commit intodevfrom
paul/fix/release-fixes
Open

small fixes for release#2019
paul-nechifor wants to merge 1 commit intodevfrom
paul/fix/release-fixes

Conversation

@paul-nechifor
Copy link
Copy Markdown
Contributor

Problem

Closes DIM-XXX

Solution

Breaking Changes

How to Test

Contributor License Agreement

  • I have read and approved the CLA.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR makes two code fixes (migrating WebcamConfig from @dataclass to Pydantic and simplifying the lidar timestamp repair function) and propagates a new --no-extra unitree-dds flag across all install commands in docs, scripts, and quickstart guides.

  • webcam.py: Removes the @dataclass decorator and switches field() to Pydantic Field(), correctly aligning WebcamConfig with its Pydantic BaseModel ancestry.
  • lidar.py: The timestamp repair change was merged with an unresolved git conflict — the file contains a raw <<<<<<< HEAD marker at line 108 (Python SyntaxError on import) and leaves prev_good used as both a scalar and an indexed container in the same closure.
  • Docs / install scripts: Six files consistently add --no-extra unitree-dds to exclude that optional dependency group from default installs.

Confidence Score: 1/5

Not safe to merge — dimos/robot/unitree/type/lidar.py contains a raw git conflict marker that makes the file unparseable by Python.

The lidar module was committed with an unresolved merge conflict: the <<<<<<< HEAD marker at line 108 causes an immediate SyntaxError on import, and the surrounding code leaves prev_good used as both a plain scalar and an indexed container in the same function body. Any consumer of repair_stale_ts is completely broken until this is resolved.

dimos/robot/unitree/type/lidar.py requires a proper conflict resolution before this can be merged; all other files look correct.

Important Files Changed

Filename Overview
dimos/robot/unitree/type/lidar.py Critical: contains a raw <<<<<<< HEAD merge conflict marker at line 108, causing a SyntaxError on import; the conflict also left prev_good used inconsistently as both a scalar and an indexed container.
dimos/hardware/sensors/camera/webcam.py Drops @dataclass decorator and switches field() to pydantic Field() — correct since CameraConfig inherits from BaseModel.
scripts/install.sh All four uv sync invocations (Nix + non-Nix, dry-run + real) updated to include --no-extra unitree-dds.
AGENTS.md Adds --no-extra unitree-dds to the install command to exclude the Unitree DDS extra.
README.md Same --no-extra unitree-dds addition mirrored in the README quick-start.
docs/installation/ubuntu.md Install command updated to exclude unitree-dds extra, consistent with other docs.
docs/installation/osx.md Install command updated to exclude unitree-dds extra, consistent with other docs.
docs/development/testing.md Install command in testing docs updated to exclude unitree-dds extra.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Incoming lidar item (T)"] --> B{use_system_time?}
    B -- Yes --> C["item.ts = now()"]
    C --> R["return item"]
    B -- No --> D{calibrated?}
    D -- No --> E["compare item.ts vs prev_raw"]
    E --> F["update prev_raw, n_seen"]
    F --> G{prev_good != None and item.ts <= prev_good?}
    D -- Yes --> G
    G -- Yes --> H["item.ts = prev_good + default_period (stale stamp repair)"]
    G -- No --> I["prev_good = item.ts"]
    H --> I
    I --> J{not calibrated and n_seen >= calibration_frames?}
    J -- Yes --> K["use_system_time = True, log warning"]
    J -- No --> R
    K --> R
Loading

Reviews (2): Last reviewed commit: "exclude unitree-dds" | Re-trigger Greptile

Comment on lines 99 to 103
def _repair(item: T) -> T:
if prev_good[0] is not None and item.ts <= prev_good[0]:
old = item.ts
item.ts = prev_good[0] + default_period
logger.warning("repair_stale_ts: stale stamp %.6f → %.6f", old, item.ts)
prev_good[0] = item.ts
return item
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.

P2 Silent timestamp repair reduces observability

The logger.warning that recorded both the original stale stamp and the repaired value was removed. Without it, there is no way to detect (in logs or metrics) how often the stale-stamp bug fires in production, making it harder to notice if the condition starts occurring more frequently or signals a new firmware regression. If the intent is to reduce log noise, consider using logger.debug instead of dropping the diagnostic entirely.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

❌ 13 Tests Failed:

Tests completed Failed Passed Skipped
13 13 0 0
View the top 3 failed test(s) by shortest run time
::dimos.core.test_core
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
dimos/core/test_core.py:23: in <module>
    from dimos.core.testing import MockRobotClient
dimos/core/testing.py:25: in <module>
    from dimos.robot.unitree.type.lidar import pointcloud2_from_webrtc_lidar
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.core.test_stream
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
dimos/core/test_stream.py:25: in <module>
    from dimos.core.testing import MockRobotClient
dimos/core/testing.py:25: in <module>
    from dimos.robot.unitree.type.lidar import pointcloud2_from_webrtc_lidar
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.mapping.pointclouds.test_occupancy
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../mapping/pointclouds/test_occupancy.py:33: in <module>
    from dimos.utils.testing.test_moment import Go2Moment
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../utils/testing/test_moment.py:23: in <module>
    from dimos.robot.unitree.go2 import connection
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.mapping.test_voxels
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
dimos/mapping/test_voxels.py:27: in <module>
    from dimos.utils.testing.test_moment import Go2Moment
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../utils/testing/test_moment.py:23: in <module>
    from dimos.robot.unitree.go2 import connection
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.memory2.test_visualizer
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
dimos/memory2/test_visualizer.py:32: in <module>
    from dimos.robot.unitree.go2.connection import GO2Connection
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.msgs.sensor_msgs.test_PointCloud2
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../msgs/sensor_msgs/test_PointCloud2.py:20: in <module>
    from dimos.robot.unitree.type.lidar import pointcloud2_from_webrtc_lidar
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.perception.detection
Stack Traces | 0s run time
.../perception/detection/conftest.py:40: in <module>
    from dimos.robot.unitree.go2 import connection
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.robot.unitree.go2.blueprints.smart.unitree_go2_vlm_stream_test
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../blueprints/smart/unitree_go2_vlm_stream_test.py:19: in <module>
    from dimos.robot.unitree.go2.blueprints.basic.unitree_go2_basic import unitree_go2_basic
.../blueprints/basic/unitree_go2_basic.py:27: in <module>
    from dimos.robot.unitree.go2.connection import GO2Connection
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.robot.unitree.testing.test_actors
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../unitree/testing/test_actors.py:24: in <module>
    from dimos.robot.unitree.type.map import Map as Mapper
.../unitree/type/map.py:33: in <module>
    from dimos.robot.unitree.go2.connection import Go2ConnectionProtocol
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.robot.unitree.testing.test_tooling
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../unitree/testing/test_tooling.py:20: in <module>
    from dimos.robot.unitree.type.lidar import pointcloud2_from_webrtc_lidar
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.robot.unitree.type.test_lidar
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../unitree/type/test_lidar.py:23: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.utils.testing.test_moment
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../utils/testing/test_moment.py:23: in <module>
    from dimos.robot.unitree.go2 import connection
.../unitree/go2/connection.py:47: in <module>
    from dimos.robot.unitree.connection import UnitreeWebRTCConnection
.../robot/unitree/connection.py:44: in <module>
    from dimos.robot.unitree.type.lidar import (
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107
::dimos.utils.testing.test_replay
Stack Traces | 0s run time
.venv/lib/python3.12.../site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:561: in import_path
    mod = _import_module_using_spec(
.venv/lib/python3.12....../site-packages/_pytest/pathlib.py:725: in _import_module_using_spec
    spec.loader.exec_module(mod)  # type: ignore[union-attr]
.venv/lib/python3.12.../_pytest/assertion/rewrite.py:185: in exec_module
    exec(co, module.__dict__)
.../utils/testing/test_replay.py:21: in <module>
    from dimos.robot.unitree.type.lidar import pointcloud2_from_webrtc_lidar
E     File ".../unitree/type/lidar.py", line 108
E       <<<<<<< HEAD
E   IndentationError: expected an indented block after function definition on line 107

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@paul-nechifor paul-nechifor changed the title exclude unitree-dds small fixes for release May 8, 2026
@paul-nechifor paul-nechifor enabled auto-merge (squash) May 8, 2026 17:10
@paul-nechifor paul-nechifor force-pushed the paul/fix/release-fixes branch from 0991b61 to 7f56518 Compare May 8, 2026 17:13
Comment on lines 108 to 138
@@ -119,9 +120,7 @@ def _repair(item: T) -> T:
n_seen += 1

if prev_good is not None and item.ts <= prev_good:
old = item.ts
item.ts = prev_good + default_period
logger.warning("repair_stale_ts: stale stamp %.6f → %.6f", old, item.ts)

prev_good = item.ts

@@ -133,6 +132,9 @@ def _repair(item: T) -> T:
calibration_frames,
)

if prev_good[0] is not None and item.ts <= prev_good[0]:
item.ts = prev_good[0] + default_period
prev_good[0] = item.ts
return item
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.

P0 Committed merge conflict — file unparseable

Line 108 contains a raw <<<<<<< HEAD conflict marker, so Python will raise a SyntaxError when this module is imported, breaking every code path that depends on repair_stale_ts. Beyond the marker, the conflict also left two mutually incompatible representations of prev_good in the same function body: the earlier code treats it as a float | None scalar (prev_good = item.ts), while lines 135–137 treat it as an indexable container (prev_good[0]). Even after removing the conflict marker, prev_good[0] on a float | None would raise a TypeError at runtime.

The file needs a clean resolution that picks one approach (scalar + nonlocal, or a single-element list for implicit closure mutation) and applies it consistently throughout _repair.

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.

1 participant