Skip to main content

openrois-gateway

Python

The OpenRoIS gateway: the process that hosts the main RoIS HRI Engine and faces the network.

Adapters and lower gateways connect to it as child engines on the path /adapter. Service applications connect as clients on any other path. The gateway discovers each child engine's components, aggregates their profiles, holds the bindings, runs command sequences across the child engines, and routes every RoIS call and every event to where it belongs. It composes Engine and WsServer from openrois-engine into a process with configuration, logging and a graceful stop.

Install

pip install openrois-gateway

The gateway needs Python 3.12 or later. With uv, which fetches Python itself, it runs with no install:

uvx --python 3.12 --from openrois-gateway openrois-gateway

Run

openrois-gateway                      # listens on ws://127.0.0.1:8765
openrois-gateway --host 0.0.0.0 --port 9000
python -m openrois.gateway --config gateway.yaml

Ctrl+C or SIGTERM stops the gateway: it closes every connection with code 1001 and exits with code 0.

The gateway does not authenticate its peers, so it binds loopback by default. Bind another interface only on a network you trust, and the gateway logs a warning when you do. Phones and headsets need this, since they cannot reach a gateway on loopback.

Docker

# From the repository root.
docker build -f services/gateway/Dockerfile -t openrois-gateway .
docker run --rm -p 127.0.0.1:8765:8765 openrois-gateway --log-level debug

Inside the container the gateway listens on every interface, so Docker can publish the port. Publish it on 127.0.0.1 unless the network is trusted. Settings come from OPENROIS_GATEWAY_* variables (-e) or flags after the image name.

compose.yaml at the repository root runs the gateway with the mock adapter behind it:

docker compose up --build
python testing/conformance/wire_check.py

The check connects as a client, waits until the adapter's components appear, and runs the conformance list. It needs only the websockets package and exits with 0 when every scenario passes.

Configuration

Each source overrides the one before it: the defaults, a YAML file, the environment, and the command-line flags.

Setting Flag Environment Default
Interface to bind --host OPENROIS_GATEWAY_HOST 127.0.0.1
TCP port, 0 for a free one --port OPENROIS_GATEWAY_PORT 8765
Engine id in the profile --engine-id OPENROIS_GATEWAY_ENGINE_ID gateway
Log level: debug, info, warning, error --log-level OPENROIS_GATEWAY_LOG_LEVEL info
Seconds to wait for a child engine's reply --child-timeout OPENROIS_GATEWAY_CHILD_TIMEOUT 10
YAML file with settings --config OPENROIS_GATEWAY_CONFIG None

The YAML file is a flat mapping with the setting names below. A key it does not know is an error.

host: 127.0.0.1
port: 8765
engine_id: gateway
log_level: info
child_timeout: 10
Exit code Meaning
0 Stopped by a signal
1 The gateway could not start, for example because the port is taken
2 The configuration is invalid

Embed

import asyncio

from openrois.gateway import Gateway, GatewayConfig


async def main() -> None:
    gateway = Gateway(GatewayConfig(port=0))
    stop = asyncio.Event()
    # run() serves until SIGTERM, SIGINT, or until the event is set.
    await gateway.run(stop)


asyncio.run(main())

start() and stop() are available on their own, and port reports the bound port.

Test

pip install -e "./services/gateway[dev]"
cd services/gateway && pytest && mypy && ruff check src/ tests/

Status

Alpha, pre-1.0, unstable API. The gateway answers the RoIS method catalog that the JavaScript SDK and the OpenRoIS Inspector speak, with the RoIS behavior of CP1 to CP3 that openrois-engine implements, and makes no conformance claim. Authentication is planned for v0.3, so the gateway binds to loopback by default. Health endpoints and a compose healthcheck are next on the roadmap.

License

Apache-2.0.

Metadata

Release files for openrois-gateway 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openrois-gateway 0.1.0
File Size Uploaded Provenance Actions
openrois_gateway-0.1.0.tar.gz 16.9 kB With provenance Details for openrois_gateway-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openrois-gateway 0.1.0
File Interpreter ABI Platform Actions
openrois_gateway-0.1.0-py3-none-any.whl Python 3 none any Details for openrois_gateway-0.1.0-py3-none-any.whl

Total release size: 30.5 kB

Release files / openrois_gateway-0.1.0.tar.gz

Download URL openrois_gateway-0.1.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7e41c7c13452119640cbb57383cd8ebb22bc72237da395ccd08d21eb6dbbd175
BLAKE2b-256 checksum
How to use checksums
13ee4f31749c8c6103dcb23ba2eb2c72773167d42b851bd3b0b6c201f12d68aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / openrois_gateway-0.1.0-py3-none-any.whl

Download URL openrois_gateway-0.1.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d0ef9a5b21d2911baaa00d27622f293d7bc03bd53f0f4e189b1e58aa71b36d5
BLAKE2b-256 checksum
How to use checksums
ae8c65914052e8cb604eab1650cd2305d81842c9bf3a77552d2c4d3fabc68460
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for openrois-gateway 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openrois_gateway-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page