Fix bool inputs incorrectly compiled as NumberInput in code execution nodes#3729
Open
Fix bool inputs incorrectly compiled as NumberInput in code execution nodes#3729
Conversation
Boolean values in code_inputs are incorrectly compiled as NumberInput (True -> 1.0, False -> 0.0) because isinstance(True, int) returns True in Python. This causes bugs when workflows with bool code inputs are run via the API execution path (deployed context) since the backend receives a number instead of a boolean. Also adds venv to flake8 exclude list to fix pre-existing hook issue. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… nodes In Python, bool is a subclass of int, so isinstance(True, int) returns True. This caused _compile_code_inputs to convert boolean values to NumberInput (True -> 1.0, False -> 0.0) instead of preserving them as booleans via JsonInput. This affected the API execution path used when packages, non-default runtimes, or secrets are present. The fix adds a bool check before the (float, int) check in the type dispatch chain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dvargas92495
approved these changes
Feb 17, 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
boolis a subclass ofint, soisinstance(True, int)returnsTrue. This caused_compile_code_inputsto convert boolean values toNumberInput(True->1.0,False->0.0) instead of preserving them as booleans viaJsonInput.boolisinstance check before the(float, int)check in the type dispatch chain within_compile_code_inputs.Test plan
test_run_node__bool_inputthat verifies boolean inputs are compiled asJsonInput(value=True)rather thanNumberInput(value=1.0)🤖 Generated with Claude Code