fix(jumanji): prevent IndexError in routing render when no valid nodes - #416
Merged
Trinkle23897 merged 1 commit intoMay 22, 2026
Merged
Conversation
hobostay
force-pushed
the
fix/jumanji-routing-index-error
branch
from
May 22, 2026 15:13
7e993b8 to
c0ecb6a
Compare
Trinkle23897
approved these changes
May 22, 2026
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.
Summary
Fix an IndexError in the Jumanji routing renderer's
build_edges()method that crashes when an agent has no valid connected nodes.Root Cause
In
envpool/jumanji/_official_render/routing.pyline 656:When
conn_groupcontains only-1values (no valid connected nodes for an agent),np.where(conn_group != -1)[0]returns an empty array. Accessing[-1]on an empty array raisesIndexError.Fix
Add a guard to check if there are valid indices before proceeding:
Test plan