Fix three bugs in step_manager (missing return, wrong error text, header array shape) - #33
Merged
Merged
Conversation
An unsupported body_type constructed the error BaseResult but did not return it, so execution fell through and PUT the step with an empty body and no Content-Type header. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
The non-request-step guard reported "cannot have a body added" when rejecting an assertion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
The REST API documents header values as arrays of strings
(e.g. {"Content-Type": ["application/json"]}); bare strings relied
on undocumented server leniency.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
Keep both the PR's existing tests and the new tests added to master after the PR was branched off. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dshirsath
approved these changes
Aug 12, 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
returnso unsupportedbody_typeerrors short-circuit before any API call is madeadd_assertion_to_stepfor non-request stepsContent-Typeheader values emitted byadd_body_to_stepto arrays (e.g.["application/json"]) to match the API's expected wire formatChanges
src/tools/step_manager.py: early return on unsupportedbody_type, fixed assertion guard error text,Content-Typevalues now arrays for all body types (json/xml/html/text)tests/test_step_manager.py: regression tests for all three fixes; merged master's new step-authoring testspyproject.toml: bumped version to 1.3.1Test plan
make testpasses (127 tests)add_body_to_stepwith an unsupported body_type returns an error without calling the APIadd_assertion_to_stepon a non-request step returns the correct error messageadd_body_to_stepwithbody_type=jsonsendsContent-Type: ["application/json"]in the PUT payload