Fix describe_outputs crash when tool_state is a dict not a JSON string#1654
Merged
mvdbeek merged 1 commit intoJul 1, 2026
Merged
Conversation
After a green run .ga files can carry tool_state as a dict rather than a JSON-encoded string; json.loads then raised TypeError. Mirror the guard already used in the lint path (PR galaxyproject#1626). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mvdbeek
approved these changes
Jul 1, 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.
Problem
describe_outputs(planemo/galaxy/workflows.py) read steptool_statewith an unconditionaljson.loads:Some
.gaworkflows carrytool_stateas an already-decoded dict rather than a JSON-encoded string. On those,json.loadsraises:This fires on the
planemo test/ report path (viaget_outputs→describe_outputs) for a workflow that otherwise runs green.Fix
Guard on type before decoding — the exact pattern already merged for the lint path in #1626, which missed this second call site. This keeps
workflow_lintandplanemo testconsistent in how they tolerate dicttool_state:Test
Adds
test_describe_outputs_dict_tool_state, reusing the existingwf14-unlinted-best-practices-dict-tool-state.gafixture (its step 0 hastool_id: null+ dicttool_state— exactly this path). Verified red→green: without the fix the test reproduces theTypeError; with it, the file's tests pass.🤖 Generated with Claude Code