mcp_json_rest_bridge: synthesize JSON-RPC response for headers-only upstream responses
When a backend returns a headers-only response (e.g. 204 No Content), the bridge filter was passing it straight through with no body. MCP clients hang or throw because they expect a JSON-RPC response with a matching id.
Closes the TODO(guoyilin42) at line 363 in the filter. Fix injects a synthetic response in encodeHeaders when end_stream=true:
tools/call: empty ToolResult, isError derived from status codetools/list: JSON-RPC -32000 error (nothing to return)
Uses the same addEncodedData pattern as grpc_http1_reverse_bridge for trailer-only responses. Three new unit tests covering 204 success, 5xx error, and tools/list 204.
@guoyilin42 quick question before you review; for the tools/call 204 case I went with an empty ToolResult (content: [{type: text, text: ""}], isError: false) since that seemed closest to what the TODO suggested. But wanted to confirm:
- Is empty ToolResult the right shape, or would you prefer a JSON-RPC result here?
- Should 304 Not Modified be treated the same way as 204?
Happy to adjust before this gets any further review.
/assign @guoyilin42
/assign @paulhong01
/wait