[PR #5586] Fix: Handle END node specially in _control_branch to prevent unknown … #4540

Closed
opened 2026-02-20 17:50:21 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/5586

State: closed
Merged: No


…channel warning

Fixes the "unknown channel branch:to:end" warning that occurs when using Command(goto=END, update={...}) in subgraphs. The issue was caused by the _control_branch function creating a branch channel for the END node, which is a special terminal node that should be handled directly like in the _control_static function.

Changes made:

Modified _control_branch function to handle END node specially
When Command(goto=END) is used, now returns END directly instead of creating "branch:to:end" channel
Applied the same logic for both single and multiple destination cases
Maintains consistency with existing _control_static function behavior
Closes #5572

Issue
#5572

Dependencies
None - this is a pure bug fix that doesn't introduce new dependencies.

Testing
Verified fix eliminates the warning while preserving all functionality
Tested with existing test_graph_validation_with_command test case
Confirmed backward compatibility with normal node routing
No breaking changes introduced

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/5586 **State:** closed **Merged:** No --- …channel warning Fixes the "unknown channel branch:to:end" warning that occurs when using Command(goto=END, update={...}) in subgraphs. The issue was caused by the _control_branch function creating a branch channel for the END node, which is a special terminal node that should be handled directly like in the _control_static function. Changes made: Modified _control_branch function to handle END node specially When Command(goto=END) is used, now returns END directly instead of creating "branch:to:end" channel Applied the same logic for both single and multiple destination cases Maintains consistency with existing _control_static function behavior Closes #5572 Issue #5572 Dependencies None - this is a pure bug fix that doesn't introduce new dependencies. Testing Verified fix eliminates the warning while preserving all functionality Tested with existing test_graph_validation_with_command test case Confirmed backward compatibility with normal node routing No breaking changes introduced
yindo added the pull-request label 2026-02-20 17:50:21 -05:00
yindo closed this issue 2026-02-20 17:50:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#4540