Skip to content

Fix logical NOT for string-backed boolean values - #1191

Merged
facontidavide merged 1 commit into
BehaviorTree:masterfrom
fallenmi:agent/fix-subtree-literal-booleans
Sep 20, 2026
Merged

facontidavide merged 1 commit into
BehaviorTree:masterfrom
fallenmi:agent/fix-subtree-literal-booleans

Conversation

@fallenmi

Copy link
Copy Markdown
Contributor

Fixes #1122.

Literal values passed to a SubTree remain strings in its blackboard. Script unary logical NOT rejected every string, including values that use the standard boolean spellings accepted by convertFromString<bool>.

Allow ! to interpret only true/True/TRUE/1 and false/False/FALSE/0. Other strings still raise the existing Invalid operator for std::string error, and the blackboard values remain unchanged for string consumers.

Regression coverage includes:

  • the reported _skipIf="!enabled" path;
  • lowercase, capitalized, uppercase, and remapped 1/0 values;
  • preservation of the original string values;
  • rejection of a numeric-prefix string that is not a boolean.

Validation

  • cmake --build build --target behaviortree_cpp_test --parallel 8
  • ./build/tests/behaviortree_cpp_test --gtest_filter='SubTree.*:Preconditions.*:ParserTest.*:PortTest.*:PortTypeRules.*' — 110 passed
  • uvx pre-commit run -a
  • git diff --check

AI assistance disclosure

OpenAI Codex reproduced the issue, drafted the code and tests, checked the visible upstream overlap surface, and ran the validation listed above. The account owner remains responsible for the contribution.

@fallenmi
fallenmi marked this pull request as ready for review August 25, 2026 12:35
@facontidavide facontidavide self-assigned this Aug 31, 2026
@facontidavide
facontidavide merged commit b4c070b into BehaviorTree:master Sep 20, 2026
16 checks 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.

Script error with boolean operator on subtree input

2 participants