Repository navigation
Conversation
dvadovsz
marked this pull request as ready for review
December 2, 2026 22:35
A SubTree model port declared with an empty default, default="", was treated as mandatory, so a parent that did not remap it failed with "is defining a mandatory port called [...], but you are not remapping it". The check tested the default's string form rather than whether a default was declared, so "defaults to empty" and "no default" became the same case. Gate on the Any instead, as writeTreeNodesModelXML and the XSD generator already do. Fixes BehaviorTree#1300 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dvadovsz
force-pushed
the
fix/subtree-port-empty-default
branch
from
December 2, 2026 22:44
03f825b to
124d366
Compare
dvadovsz
added a commit
to PickNikRobotics/BehaviorTree.CPP
that referenced
this pull request
Dec 2, 2026
A SubTree model port declared with an empty default, default="", was treated as mandatory, so a parent that did not remap it failed with "is defining a mandatory port called [...], but you are not remapping it". The check tested the default's string form rather than whether a default was declared, so "defaults to empty" and "no default" became the same case. Gate on the Any instead, as writeTreeNodesModelXML and the XSD generator already do. Upstream: issue BehaviorTree#1300, PR BehaviorTree#1301. Drop this commit once a release carries it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from dvadovsz/BehaviorTree.CPP@124d366)
This branch has not been deployed
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.
Fixes #1300.
The mandatory-port check in
recursivelyCreateSubtreenow testsdefaultValue().empty()instead ofdefaultValueString().empty().writeTreeNodesModelXMLand the XSD generator already test it this way. A port withdefault=""is now optional and gets an empty string. A port with nodefaultattribute is still mandatory.SubTree.EmptyModelDefaultIsNotMandatoryingtest_subtree.cppcovers both cases. It fails onmasterand passes with the fix.One thing worth noting: the
_autoremapbranch just above (:1231) still checks!default_value.empty(). It only decides whether a missing parent key falls back to the literal default, and autoremapped ports are never mandatory, so I left it alone.There is no API or ABI change. The behavior change is that a tree which used to fail to load because of an unremapped
default=""port now loads.