Skip to content

fix(ros2): reject non-positive action server result_timeout#822

Merged
maciejmajek merged 2 commits into
RobotecAI:bartok9/fixesfrom
Bartok9:fix/action-server-reject-nonpositive-result-timeout
Jul 22, 2026
Merged

fix(ros2): reject non-positive action server result_timeout#822
maciejmajek merged 2 commits into
RobotecAI:bartok9/fixesfrom
Bartok9:fix/action-server-reject-nonpositive-result-timeout

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Reject non-positive / non-numeric result_timeout at ROS2ActionAPI.create_action_server before constructing the rclpy ActionServer.
  • bool is rejected explicitly (False must not pass as 0).

Motivation

result_timeout controls how long action results are retained. Invalid values (≤0 or non-numeric) should fail at the RAI boundary rather than being forwarded into undefined rclpy behavior.

Verification

PYTHONPATH=src/rai_core python -m pytest tests/communication_offline/test_action_server_result_timeout.py -q
# 5 passed

Offline tests extract and execute the guard from source (no rclpy required).

  • Did NOT change: default result_timeout=900, QoS profiles, send_goal path.

Notes

Paths are orthogonal to open Bartok9 TF/service work on connectors/base.py / service.py / topic.py.


Agent-Owner: sera · Platform: hermes · Claim-TTL: 24h

Fail closed when create_action_server receives a non-positive or non-numeric
result_timeout (bool rejected). Prevents undefined rclpy ActionServer result
lifecycle cleanup with invalid timeouts.

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
@maciejmajek
maciejmajek changed the base branch from main to bartok9/fixes July 22, 2026 09:59

@maciejmajek maciejmajek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contrib! Similarly to the previous PR, the added test will create a burden going forward. Tests should be easy to understand & maintain. Please consider keeping the path untested or rewrite to minimize complexity.

Remove the AST-extract/exec offline test harness for the
result_timeout guard. Per maintainer request, keep the validation
path untested rather than carry a test that is hard to maintain.
The guard itself (TypeError/ValueError on non-positive or
non-numeric result_timeout) is unchanged.
@Bartok9

Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown
Author

Thanks @maciejmajek — understood, and agreed. I've removed the offline test harness in 531b51a; the guard now ships untested to keep the test surface minimal and maintainable. The validation itself (TypeError on non-numeric/bool, ValueError on <=0) is unchanged. Appreciate the review.

@maciejmajek
maciejmajek merged commit 5e0a2bc into RobotecAI:bartok9/fixes Jul 22, 2026
1 check passed
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