Skip to content

Fix three bugs in step_manager (missing return, wrong error text, header array shape) - #33

Merged
pjain05 merged 5 commits into
masterfrom
fix/step-manager-bugs
Aug 12, 2026
Merged

pjain05 merged 5 commits into
masterfrom
fix/step-manager-bugs

Conversation

@pjain05

@pjain05 pjain05 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes a missing return so unsupported body_type errors short-circuit before any API call is made
  • Corrects a copy-pasted error message in add_assertion_to_step for non-request steps
  • Changes Content-Type header values emitted by add_body_to_step to arrays (e.g. ["application/json"]) to match the API's expected wire format

Changes

  • src/tools/step_manager.py: early return on unsupported body_type, fixed assertion guard error text, Content-Type values 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 tests
  • pyproject.toml: bumped version to 1.3.1

Test plan

  • make test passes (127 tests)
  • Verify add_body_to_step with an unsupported body_type returns an error without calling the API
  • Verify add_assertion_to_step on a non-request step returns the correct error message
  • Verify add_body_to_step with body_type=json sends Content-Type: ["application/json"] in the PUT payload

Supersedes #28 (same fixes, rebased on master with merge conflict resolved)

benjithompson and others added 5 commits July 8, 2026 13:19
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>
@pjain05
pjain05 merged commit 229425e into master Aug 12, 2026
5 checks passed
@pjain05
pjain05 deleted the fix/step-manager-bugs branch August 12, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants