feat(harness): add register_stream_scenario to the Python HarnessServiceClient - #32
Merged
Merged
Conversation
…iceClient The generated SSE stream contract tests call `harness.register_stream_scenario(...)`, but the hand-written Python HarnessServiceClient only had `register_scenario` (channels) — so the tests failed with AttributeError. Add the SSE counterpart, POSTing to `/stream-scenarios` (the TS client's `registerStreamScenario` equivalent; the endpoint shipped in channel-harness 0.3.0/0.4.0). Verified: with channel-harness 0.4.0 + this method, the regenerated tests/contract/streams/test_ai.py passes 2/2 against the live harness. Co-Authored-By: Claude Opus 4.8 (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.
What changed
Adds
register_stream_scenarioto the hand-written PythonHarnessServiceClient(phx_channel/harness.py) — the SSE counterpart to the existingregister_scenario(channels). It POSTs to the harness's/stream-scenarioscontrol endpoint.Why
The generated SSE stream contract tests (
tests/contract/streams/test_*.py) callharness.register_stream_scenario(...), but the Python client only hadregister_scenario, so they failed:(The TS harness client already has
registerStreamScenario; this is the Python equivalent. The/stream-scenariosendpoint shipped in channel-harness 0.3.0/0.4.0.)Scope / risk
Low — one method on a test-harness client, mirroring
register_scenario. Test tooling only; no SDK runtime change.Testing
Verified end-to-end: with
@archastro/channel-harness@0.4.0(already on main) + this method, regenerating and running the generated SSE stream contract test passes 2/2 against the live harness subprocess (tests/contract/streams/test_ai.py— event-order assertion + 402→ApiError).Unblocks
This is the last piece for the archastro-python auto-regen (PR #30): with this on main, re-running the regen produces a green CI (ruff already fixed via the generator; harness already at 0.4.0).