Repository navigation
Conversation
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.
Please ensure you have read the contribution guide before creating this pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
ModuleNotFoundErrors#8347 (different CLI error-handling gap; no issue was filed for this graph crash)2. Or, if no issue exists, describe the change:
Problem: The Dev UI agent graph crashed with
IndexError: list index out of rangefor a valid agent tree containing an emptySequentialAgent/LoopAgent.build_cluster()indexessub_agents[0]for the parent edge even though the runtime explicitly allows an empty workflow shell (sequential_agent.py:99-100) andsub_agentsdefaults to[].Solution: Guard the parent→first-sub-agent edge with
if parent_agent and agent.sub_agents:in both branches. An empty workflow now draws its labelled cluster with no child edges. Non-empty rendering is byte-identical to base (verified 6/6 DOT sources). Per CONTRIBUTING, new bugs may be described in a PR using the issue template.Testing Plan
Unit Tests:
New parametrized tests cover empty Sequential/Loop as root and as a child (4 cases). Base-red: 2 failed / 12 passed with
IndexError; with fix 14/14 passed.ruff checkandisort --check-onlyclean on both files.Manual End-to-End (E2E) Tests:
Not run offline: no real model, network, or credentials available. The graph is pure logic; DOT source is asserted in unit tests without the
dotbinary.Checklist
Additional context
The repo uses pyink (unavailable offline), so
ruff formatwas not used; new code matches surrounding style. Broader CLI tests could not be collected offline due to pre-existing missing-dependency errors unrelated to this change.