Repository navigation
test(generate): a Python client streams all four RPC shapes through the companion - #1161
Merged
Merged
Conversation
…he companion `codefly generate client --language python` renders its facade with the proto companion's protoc-gen-codefly-facade-python, which lives in core (companions/proto/facades/python). Core fixed it in 08716e9: each streaming RPC calls the gateway seam named for its shape (unary_stream, stream_unary, stream_stream). It shipped inside proto:0.0.17 without a version bump, and 0.0.17 was republished at 20:42 UTC, so a machine holding the earlier 0.0.17 still renders every RPC as `unary` — the model gateway's generated model.py is that output. The test generates a client from a proto carrying all four method kinds through `codefly generate client`, asserts each method's seam, and drives every method against a real grpcio server inside the companion image. It fails against the earlier 0.0.17 (sha256:aa8d63e1) and passes against the published one (sha256:46e8b398). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
Merged
Merged
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.
Finding
Review r38 of obin-ai/module-model-gateway#210 saw the Python client generator emit the model gateway's four streaming RPCs as unary calls (
libraries/model-client/python/model_client/model.py).The generator template is not in the CLI.
codefly generate client --language pythonrenders the facade with the proto companion'sprotoc-gen-codefly-facade-python, owned by core (companions/proto/facades/python/). Core already fixed it in codefly-dev/core@08716e9: each streaming RPC calls the gateway seam named for its shape (unary/unary_stream/stream_unary/stream_stream, withrequestsfor client streams). The CLI's core pin (88f4434c) includes that commit.The defect that reached the model gateway is a stale companion image under an unchanged tag. 08716e9 shipped inside
proto:0.0.17without a version bump. 0.0.17 was first published assha256:aa8d63e1…(old plugin) and republished at 20:42Z assha256:46e8b398…(streaming plugin). The CLI uses a cached tag when one is present, so a machine holding the first image still renders everythingunary. Filed as codefly-dev/core#837: bump the companion to 0.0.18, plus a CI guard. That bump moves this repo'sgo.mod, so it waits behind #1158.Change
A generator test over a proto with all four method kinds, run through
codefly generate clientand the real companion. It is not a check of core's template source, because that is exactly what missed a companion still shipping the old plugin.cmd/generate/client_streaming_test.go:TestGenerateClientPythonStreaminggeneratesshapes-clientfrom a contracts catalog and asserts each method's seam in the generated facade. It then runstestdata/python_streaming/exercise.pyinside the companion image (its own grpcio and generated bindings). That script drives every facade method against an in-process grpcio server: unary, server stream, client stream (including empty) and bidi (including empty).linux-amd64-docker-generate(CODEFLY_GENERATE_QUALIFY=1, developer machine; CI skips it).Evidence, run locally on darwin/arm64 with
CODEFLY_GENERATE_QUALIFY=1:proto:0.0.17=sha256:aa8d63e1: FAIL,shapes.py does not contain "self._gateway.unary_stream(\"/shapes.v1.EchoService/Fan\","docker pull(sha256:46e8b398): PASS,all four generated RPC shapes passedTransport: the facade names the shape and the Gateway owns the transport, the same as
unarytoday. A Gateway would serveunary_streamon Connect andstream_unary/stream_streamon gRPC, because Connect's client and bidi streams need HTTP/2, and the Python Connect face serves them on gRPC only. No runtime Gateway implements the three streaming seams yet:solution-runtime-pythonhasunaryonly. There is no Python consumer of the model client's streaming methods today, so that is left as a gap rather than built ahead of a consumer.Classification
Fix (test-only here). The generator fix lives at its owner (core 08716e9); the version-discipline fix is core#837. Nothing here touches #1158's files.
Not verified: CI does not run this test (the row is not-yet-qualified). I did not run the rest of the
cmd/generatequalify suite.To unblock module-model-gateway now:
docker pull ghcr.io/codefly-dev/proto:0.0.17, then regeneratelibraries/model-client.🤖 Generated with Claude Code