← Back to Pull requests

Add GoalStatusCode enum and get_status_code() to client goal handles #3292

Closed
unknown closed this pull request without merging on Oct 03, 2026 16:47 UTC
View on GitHub
unknown unknown commented on Sep 29, 2026 17:35 UTC
Author

Description

This implements #2482. ClientGoalHandle::get_status() and GenericClientGoalHandle::get_status() return int8_t. Callers have to know those values are action_msgs::msg::GoalStatus::STATUS_ constants. ResultCode does not fit, because it covers only the three terminal states.

This adds rclcpp_action::GoalStatusCode, an int8_t enum class in types.hpp with all seven GoalStatus values. Both goal handles get a get_status_code() that returns it.

The status comes straight from the server's status topic, and the client does not check it. If a server sends a value outside the seven, get_status_code() throws exceptions::InvalidGoalStatusError. get_status() still returns the raw byte.

The change only adds API, and the new GenericClientGoalHandle member is non-virtual, so existing binaries keep working.

The names are open to change. I also considered GoalState, which matches rcl_action's GOAL_STATE_, and get_goal_status().

Deprecating get_status() in favor of get_status_code() will follow in its own PR.

Fixes https://github.com/ros2/rclcpp/issues/2482

Is this user-facing behavior change?

No behavior change. New API only.

Did you use Generative AI?

Yes. Claude Code with Claude Opus 5.5 wrote the code, the tests and this description. I reviewed the change, then built and tested it.

Additional Information

I tested on rolling with rclcpp and rcl built from source. All rclcpp_action tests and linters pass. The package skips cppcheck on rolling. New assertions in test_client.cpp and test_generic_client.cpp check ACCEPTED, SUCCEEDED, UNKNOWN after invalidation, and CANCELED after cancel-all. A new get_status_code_out_of_range test in each file publishes status 42 for a live goal and checks that get_status() returns 42 and get_status_code() throws.

Diff: 236 lines (+177 / -59) across 2 files Reviewer: jmachowinski Review duration: 5711m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 236 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.327
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3292"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.2% (MEDIUM) · Higher = larger blast radius
37.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.7% · Safe to merge
14.7%
Repository