Skip to content

feat(harness): add register_stream_scenario to the Python HarnessServiceClient - #32

Merged
calvin-archastro merged 2 commits into
mainfrom
fix/python-register-stream-scenario
Jun 30, 2026
Merged

feat(harness): add register_stream_scenario to the Python HarnessServiceClient#32
calvin-archastro merged 2 commits into
mainfrom
fix/python-register-stream-scenario

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

What changed

Adds register_stream_scenario to the hand-written Python HarnessServiceClient (phx_channel/harness.py) — the SSE counterpart to the existing register_scenario (channels). It POSTs to the harness's /stream-scenarios control endpoint.

Why

The generated SSE stream contract tests (tests/contract/streams/test_*.py) call harness.register_stream_scenario(...), but the Python client only had register_scenario, so they failed:

AttributeError: 'HarnessServiceClient' object has no attribute 'register_stream_scenario'

(The TS harness client already has registerStreamScenario; this is the Python equivalent. The /stream-scenarios endpoint 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).

calvin-archastro and others added 2 commits June 30, 2026 14:18
…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>
@calvin-archastro
calvin-archastro merged commit cbe2174 into main Jun 30, 2026
5 checks passed
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.

1 participant