You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
protocol_version: enforce on HTTP dispatch path + conformance coverage
HTTP transport doesn't route through RpcServer.serve_one — it has its own
dispatch loop in vgi_rpc/http/server/_app_unary.py and _app_stream.py.
The initial commit's dispatch-boundary check was wired only in serve_one,
so HTTP clients with mismatched protocol_version dispatched straight to
the worker handler with mismatched schemas. Caught by senior review,
fixed here.
Adds the check at the same point in both HTTP unary and stream init —
after _read_request populates _current_request_metadata, before
_deserialize_params / handler dispatch. __describe__ is exempt
(diagnostic path for mismatched clients to discover the server's
version). Mismatch raises ProtocolVersionError → existing
(VersionError, RpcError) catch wraps as _RpcHttpError(BAD_REQUEST) →
client sees IOException with the directional message text intact.
Verified by mutation test against the HTTP integration suite (edit
VGI_PROTOCOL_VERSION → "2.0.0", rebuild, ATTACH fails with full
directional text).
Adds:
- 4 HTTP transport unit tests in tests/test_protocol_version.py
(matched success, mismatched directional error, describe bypass,
undeclared opt-out). These are the tests that would have caught the
blocker had they existed before.
- protocol_version conformance category: ConformanceService now
declares protocol_version="1.0.0", forcing cross-language ports to
support the new metadata key. Two describe tests
(surfaces_declared_version, format) and one round-trip
(matched_dispatch_succeeds) across every transport. Mismatch
scenarios stay in unit tests because the conformance runner is
parameterised on a single proxy — spawning two servers at different
versions doesn't fit the fixture model.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments