Skip to content

fix(gateway): unify dispatch, RPC middleware, and protocol contracts - #168

Open
kooksee wants to merge 10 commits into
v2from
fix/gateway-http-dispatch-cleanup
Open

kooksee wants to merge 10 commits into
v2from
fix/gateway-http-dispatch-cleanup

Conversation

@kooksee

@kooksee kooksee commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Unify HTTP/WS/native gRPC through Mux.DispatchFrontend, with UseRPCMiddleware so lava middleware covers unary and all stream modes for local and proxy backends.
  • Harden gRPC-Web success trailers and wire message compression via grpc-encoding / grpc-accept-encoding (default gzip).
  • Make Operation the dispatch registry SSOT; keep routerTree as an HTTP path index. Align README / design-evolution with the shipped Phase 1–3 architecture.

Test plan

  • go test ./pkg/gateway/... ./servers/gatewayserver/...
  • Smoke HTTP/JSON unary error mapping and gRPC-Web success trailer (grpc-status: 0)
  • Smoke gRPC-Web with grpc-accept-encoding: gzip and compressed request frames
  • Confirm WS / native gRPC still hit the same registered services through Mux

Made with Cursor

kooksee and others added 10 commits September 16, 2026 22:06
Hang lava middleware on Mux.UseRPCMiddleware so unary and all stream modes share one chain for local and proxy backends, and always emit gRPC-Web trailer frames on success.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cache Operation at registration time and look up via Mux helpers so routerTree stays an HTTP index by FullMethod without duplicating schema.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire gzip compressors into the HTTP/gRPC-Web framed path via grpc-encoding / grpc-accept-encoding and per-frame flags, keeping encoding headers out of trailer frames.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document UseRPCMiddleware, compression, and Operation as dispatch SSOT so public docs match the Phase 1–3 implementation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire NewGatewaySurface and UseRPCMiddleware into the multi-protocol example, expand verify for HTTP/gRPC-Web trailers and gzip, and document both example apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce a publishable JS client with createHttpJsonClient and createGrpcWebTransport, and rewire the grpcweb frontend example to consume it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add createGatewayTransport (json/binary/text), JsonRpcTransport with NDJSON streams and errorpb parsing, and rework the grpcweb demo as an agentrun-style rpc facade.

Co-authored-by: Cursor <cursoragent@cursor.com>
Check Close errors in tests/verify and drop the redundant Backend() conversion in TransparentHandler.

Co-authored-by: Cursor <cursoragent@cursor.com>
Flush server-stream bodies through Fiber SendStreamWriter so subscribe-style
WatchHello pushes reach the client incrementally, encode grpc-web-text as one
continuous base64 stream, and expand the example/SDK coverage for unary,
headers/trailers, and long-lived server streams.

Co-authored-by: Cursor <cursoragent@cursor.com>
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