fix: coerce stringified values in start_workflow data to match workflow input schema#348
Open
AutomateIP wants to merge 2 commits into
Open
fix: coerce stringified values in start_workflow data to match workflow input schema#348AutomateIP wants to merge 2 commits into
AutomateIP wants to merge 2 commits into
Conversation
…ow input schema LLMs sometimes serialize nested structures (arrays, objects) to strings when calling tools. This causes 400 Bad Request errors from the platform when the workflow input schema expects an array or object type. Added _coerce_value and _coerce_data_to_schema helpers that fetch the workflow declared input schema by route_name and convert any string values back to their correct types before the platform POST. Values that cannot be parsed or have no schema declaration are passed through unchanged so the platform still produces the real error. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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
_coerce_valueand_coerce_data_to_schemahelpers that fetch the workflow's declared input schema byroute_nameand convert stringified values back to their correct types before the platform POSTTest plan
uv run pytest tests/test_tools_operations_manager.py::TestCoerceValue— 7 unit tests for_coerce_valueuv run pytest tests/test_tools_operations_manager.py::TestCoerceDataToSchema— 3 unit tests for_coerce_data_to_schemauv run pytest tests/test_tools_operations_manager.py::TestStartWorkflowCoercion— 2 integration tests for the fullstart_workflowcoercion pathuv run pytest— full suite (2398 tests, no regressions)🤖 Generated with Claude Code