dimensionalOS / dimensionalOS/dimos

Validate control-task joint counts in the params model, not in __init__

Open
#4,097 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chore control
Dominant language
Python
Stars
4.5k
Forks
808
Avg merge
3d 5h
Merged PRs (30d)
233

Description

From Tom's review on #4096: https://github.com/dimensionalOS/dimos/pull/4096#discussion_r3997153809

BaseTrajectoryTask.__init__ checks len(joint_names) != 3 by hand, and the same check sits in __init__ on HolonomicPoseFollowerTask and PathFollowerTask. Moving it into the pydantic params model names the field in the error, reports every bad field at once, fails at config-parse time before any worker starts or hardware connects, and puts the constraint into the schema that dimos run <blueprint> --help prints.

Two things make it more than a one-line move, which is why it is not in #4096. joint_names lives on TaskConfig rather than in params, so create_task has to merge it in (model_validate({**cfg.params, "joint_names": cfg.joint_names})) or blueprints end up declaring joints twice. And the __init__ check is the only thing guarding direct construction of the dataclass config, which the tests use, so removing it needs a call on whether that path stays validated.

Worth doing across the three followers together rather than in one of them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace BaseTrajectoryTask, HolonomicPoseFollowerTask, PathFollowerTask, TaskConfig, and create_task to understand how joint_names reaches each params model. Check the tests that directly construct the dataclass config before changing validation, then verify all three followers report invalid counts during config parsing and that dimos run --help exposes the constraint without duplicate joint declarations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.