fix: @Bartok9 contributions (batch 2) - #872
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #872 +/- ##
==========================================
+ Coverage 74.48% 74.49% +0.01%
==========================================
Files 82 82
Lines 3621 3627 +6
==========================================
+ Hits 2697 2702 +5
- Misses 924 925 +1 ☔ View full report in Codecov by Harness. |
Salvages the second round of validation PRs from @Bartok9. Tool argument checks are expressed as pydantic Field constraints on the existing args_schema rather than as imperative guards in each _run, and the four genuine bug fixes are taken as-is. Signed-off-by: Bartok9 <danielrpike9@gmail.com> Co-authored-by: Bartok <danielrpike9@gmail.com>
maciejmajek
force-pushed
the
fix/bartok9-contributions-batch-2
branch
from
September 7, 2026 20:41
387c5b0 to
84f1d03
Compare
This was referenced Sep 7, 2026
boczekbartek
self-requested a review
September 8, 2026 10:44
boczekbartek
approved these changes
Sep 8, 2026
boczekbartek
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks for refactoring these PRs
maciejmajek
added a commit
to ved197338/rai
that referenced
this pull request
Sep 8, 2026
Keeps the feature and folds the validation into the tool models. The bounds live on a WorkspaceBounds mixin shared by NavigateToPoseTool, NavigateToPoseBlockingTool and Nav2Toolkit, which propagates them. Their ordering is checked once when the tool is built rather than on every goal, and Tuple[Coordinate, ...] with allow_inf_nan=False covers the shape and finiteness that coordinates.py checked by hand, so that module and its re-exports are gone. Also adds allow_inf_nan=False to NavigateToPoseBlockingToolInput, which was missed in RobotecAI#872, and constrains the bounds themselves: a plain float tuple accepts NaN, and NaN bounds silently disable every comparison. Tests now exercise the tools rather than the helpers: an out-of-bounds goal is refused before the connector is touched, one-sided bounds only constrain their side, and inverted or malformed bounds fail at construction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Proposed Changes
args_schemaasField(min_length=1),Field(gt=0)andField(allow_inf_nan=False). Enforced before_run, visible in the schema the model sees, andToolRunneralready turnsValidationErrorinto aToolMessage. Replaces fix(tools): reject non-positive topic receive/image/TF timeouts #827, fix(tools): reject non-positive CallROS2ServiceTool timeout_sec #828, fix(tools): validate configured image/TF tool timeouts #829, fix(tools): reject empty ROS topic names on publish/receive/image #831, fix(tools): reject empty ROS service name/type on CallROS2ServiceTool #832, fix(tools): reject empty ROS action name/type on StartROS2ActionTool #833, fix(tools): reject empty TF frame names on GetROS2TransformTool #834, fix(tools): reject empty topic/message_type on PublishROS2MessageTool #835, fix(nav2): reject non-finite NavigateToPose coordinates #836 in ~15 lines with no new modules.hri_connector.py: AI multimodal messages passedbase64_imagesasaudios, so images-only messages raised (fix(hri): pass base64_audios for AI multimodal to_langchain #847).configurator.py: ASR selectbox readtransciption_modelwhile the handler writestranscription_model(fix(frontend): read transcription_model key consistently in ASR config UI #859).artifacts.py:store_artifactscreates the parent directory for a newdb_path(fix(messages): honor db_path in store_artifacts #848).tool_runner.py: unknown tool names reportUnknown toolinstead of a bare KeyError repr (fix(tool_runner): return error ToolMessage for unknown tool names #853).VADConfigandWWConfigvalidate thresholds in__post_init__, matchingTranscribeConfig(fix(s2s): validate OpenWakeWord detection threshold #854, fix(s2s): validate SileroVAD detection threshold #856, fix(s2s): validate VADConfig and WWConfig thresholds and grace #866).time_interval=0withtime.sleeppatched), therai_benchtask guards (fix(bench): reject non-positive PlaceCubesTask threshold_distance #860, fix(bench): validate GroupObjectsTask threshold and obj_types #861, fix(bench): validate PlaceObjectAtCoordTask displacement and coordinates #863, fix(bench): validate RotateObjectTask obj_types and quaternion #864, fix(bench): reject empty MoveObjectsToLeftTask obj_types #865, fix(bench): validate BuildCubeTowerTask obj_types and displacement #867, fix(bench): reject empty Scenario scene_config_path #868, fix(bench): reject negative TaskArgs.extra_tool_calls #869) and the remainingrai_s2smodel guards (fix(s2s): validate SoundDeviceConfig block_size and channels #857, fix(s2s): validate BaseTranscriptionModel sample_rate and names #858, fix(s2s): reject non-positive TTSModel sample_rate and channels #862), which validate parameters only we set, and theAGENTS.mdhunk in fix(bench): validate PlaceObjectAtCoordTask displacement and coordinates #863.rai_core2.12.3,rai_s2s1.0.1,uv.lockregenerated.Issues
exceptblock intool_runner.pyand needs a rebase after this landsTesting
tests/tools/ros2/test_input_validation.pycovers every schema constraint,tests/s2s/test_asr_config.pycovers the config guards, and the bug fixes are asserted in the existing test files.pytest tests/tools tests/agents tests/messages tests/communication tests/s2s: 343 passed, 4 skipped, 11 xfailed.Co-authored-by: Bartok danielrpike9@gmail.com