Skip to content

[Voice gateway] Route one committed turn for an authenticated runtime session #8378

Closed

Description

@jyaunches

Parent

Problem Statement

The current VoiceClaw proof of concept connects directly to the OpenClaw agent gateway. VoiceClaw holds an OpenClaw credential, creates the agent session, submits turns, and correlates native OpenClaw events.

NemoClaw therefore cannot enforce the session binding, agent selection, credential boundary, turn identity, or terminal outcome.

This issue implements the first functional slice of #8275. One trusted local voice runtime must complete one committed text turn through a NemoClaw-owned boundary.

The slice must not add audio, WebRTC, RTVI, speech processing, or runtime-specific UI behavior to NemoClaw.

Desired Behavior

When the experimental voice gateway is enabled:

  1. NemoClaw authenticates one trusted local runtime or deployment.
  2. NemoClaw selects one runtime profile and OpenClaw agent from operator-controlled configuration.
  3. NemoClaw creates an expiring voice session and an in-memory binding to a generated OpenClaw session key.
  4. The runtime submits one committed text turn with a stable turn ID.
  5. NemoClaw invokes the configured agent through the accepted OpenClaw interface.
  6. NemoClaw streams ordered response text to the runtime.
  7. NemoClaw reports exactly one completed or failed terminal outcome.
  8. Closing or expiring the voice session revokes its grant and clears gateway-owned state.

The runtime continues to own media, speech recognition, speech synthesis, playback, and its client protocol.

Concrete example

A configured runtime sends a final transcript for a read-only repository-status question. The configured agent evaluates the question with its allowed tools. The runtime receives the response text and passes it to its existing output path.

The question, repository tools, prompts, and output presentation remain outside the NemoClaw gateway.

Runtime-to-agent boundary

The operation names below describe logical behavior. They do not define a public voice protocol.

Runtime -> NemoClaw: create session
NemoClaw -> Runtime: voice-session ID, expiring grant, expiry

Runtime -> NemoClaw: commit turn with turn ID and final text
NemoClaw -> OpenClaw: submit turn to generated agent session
NemoClaw -> Runtime: response.started
NemoClaw -> Runtime: ordered response.text.delta events
NemoClaw -> Runtime: response.completed or response.failed

Runtime -> NemoClaw: close session
NemoClaw: revoke grant and clear in-memory binding

No audio or runtime-native protocol messages cross this boundary.

NemoClaw Scope

NemoClaw must:

  • Require a dedicated experimental feature flag.
  • Bind the gateway listener to a loopback address.
  • Authenticate session admission with a deployment-held credential.
  • Select the runtime profile, sandbox, agent, and agent-gateway destination from trusted configuration.
  • Reject runtime-supplied agent identities, session keys, upstream URLs, and forwarding destinations.
  • Create opaque voice-session, agent-session, turn, and response identifiers.
  • Issue a cryptographically random, expiring grant scoped to one voice session.
  • Keep the OpenClaw credential in NemoClaw.
  • Apply least privilege when connecting to the OpenClaw agent gateway.
  • Submit one committed turn through the accepted OpenClaw interface.
  • Preserve response ordering and filter events by the expected agent session and run.
  • Produce distinct completed and failed outcomes.
  • Reject duplicate and overlapping turns.
  • Bound request size, response size, turn duration, and session lifetime.
  • Emit correlated lifecycle diagnostics without credentials or conversational content.
  • Revoke the session grant and clear in-memory state on close or expiry.

The generic response boundary must not contain VoiceClaw-specific speak, display, child, RTVI, or playback events.

Feature Gate

Proposed opt-in:

NEMOCLAW_EXPERIMENTAL_VOICE_GATEWAY=1

Proposed hidden foreground command:

nemoclaw internal voice-gateway serve

Requirements:

  • Without exactly 1, the command must fail before it reads credentials or binds a listener.
  • Enabling another experimental NemoClaw capability must not enable this service.
  • Normal onboarding and managed startup must not start the service.
  • The feature must not change existing agent or messaging behavior while disabled.
  • Status output must identify the experimental path without exposing content or credentials.

A hidden command alone does not satisfy the feature-gate requirement.

Acceptance Criteria

Admission and binding

  • The disabled feature creates no listener and reads no voice-gateway credential.
  • Missing or incorrect admission credentials cannot create a session.
  • Successful admission returns an opaque, expiring grant scoped to one voice session.
  • A grant cannot access a different or expired session.
  • NemoClaw records the runtime identity, voice-session ID, runtime conversation ID, configured agent, and generated agent-session key.
  • The runtime cannot override the agent, agent-session key, sandbox, or agent-gateway destination.

Agent turn

  • NemoClaw generates the OpenClaw session key.
  • The runtime does not receive an OpenClaw credential.
  • One committed turn reaches the configured agent.
  • One valid turn produces one response.started event.
  • Response text remains ordered and correlated with the voice session, turn, response, and OpenClaw run.
  • Exactly one response.completed or response.failed event terminates the response.
  • Native OpenClaw frames do not cross the runtime boundary.
  • Events for another session or run are discarded.
  • A duplicate turn ID cannot invoke the agent twice.
  • An overlapping turn receives a bounded turn_in_progress result.

Failure and cleanup

  • Agent-gateway failures produce stable, content-free reason codes.
  • Runtime disconnect stops response delivery.
  • A turn timeout bounds work that continues after runtime disconnect.
  • Session close or expiry revokes the grant and removes the in-memory binding.
  • Closing the voice session closes its direct agent-gateway connection.
  • Logs contain correlation IDs, state, reason, and timing only.
  • Logs do not contain credentials, transcripts, prompts, response text, tool arguments, or native event payloads.

Compatibility evidence

  • A deterministic integration test uses a fake runtime and fake OpenClaw agent gateway.
  • Tests cover flag-off behavior, authentication, binding, event ordering, duplicate turns, overlap, timeout, expiry, event filtering, and redaction.
  • A package contract confirms that the hidden command ships in the NemoClaw package.
  • A pinned runtime integration layer can submit a committed turn and consume the streamed response.
  • The composed test confirms that the runtime does not receive an OpenClaw credential.
  • The composed test feeds returned text into the runtime's existing output path.
  • Deterministic CI uses a repository fixture with known state instead of a live GitHub result.

Proposed OpenClaw Interface

For this experimental slice, NemoClaw should use the existing OpenClaw WebSocket interface:

  • Authenticate with operator.read and operator.write.
  • Generate the session key in NemoClaw.
  • Submit the turn with chat.send.
  • Use the turn ID as or derive the OpenClaw idempotency key from it.
  • Correlate response events by session key and run ID.
  • Do not require operator.admin or sessions.create unless validation proves that the selected interface requires them.

A requirement for additional privilege must return to maintainers as a design decision. NemoClaw must not pass the broader credential to the voice runtime.

Implementation Idea

A private HTTP interface with a streamed newline-delimited JSON response is sufficient for this slice:

  • Create a voice session.
  • Submit one turn and stream response events.
  • Close a voice session.
  • Expose a content-free health check.

The implementation should separate:

  • Session and turn state
  • OpenClaw agent-gateway communication
  • HTTP transport
  • Command and service lifetime

This separation permits a later hosted-runtime integration to use another native transport without changing the agent-turn semantics.

Reusable Security Work from #7787

PR #7787 implemented useful controls for the earlier signaling-proxy experiment. This issue should preserve these security properties where applicable:

  • Private, owner-only credential-file validation
  • Protection against symbolic-link credential files
  • Constant-time bearer comparison
  • Loopback-only listener and fixed destinations
  • Header, body, and response limits
  • Bounded deadlines
  • Content-free authentication and upstream errors
  • Disconnect handling
  • Malformed-request and shutdown tests

This issue does not include the #7787 signaling routes, SDP forwarding, Talker health probe, optional conversation_id, or deployment bearer as the voice-session model.

Constraints and Non-goals

This issue does not implement:

  • Human user authentication
  • More than one committed turn per voice session
  • Concurrent voice sessions or turns
  • Follow-up conversation continuity
  • Interruption or response supersession
  • Agent-generation or durable-work cancellation
  • Reconnect or resume
  • Persistent voice-session state
  • Public ingress, TLS, TURN, ICE, or signaling proxy routes
  • Audio, WebRTC, RTVI, VAD, STT, TTS, or playback
  • Runtime-specific UI or response envelopes
  • Voice runtime installation or supervision
  • Full NemoClaw-managed runtime lifecycle
  • VoiceClaw source changes
  • ElevenLabs implementation or compatibility claims
  • A VoiceClaw, ElevenLabs, or general voice support claim

Completion of this issue establishes an experimental runtime-to-agent turn boundary. It does not establish product support or cross-runtime compatibility.

Design Decision Required

Before a code-changing PR begins, maintainers must accept:

  • The ownership boundary in [Epic] Establish an experimental voice gateway for NemoClaw agents #8275.
  • A host-side, foreground experimental service for this slice.
  • The private runtime-facing streaming interface.
  • The OpenClaw chat.send interface and required scopes.
  • The trusted deployment identity used for initial admission.
  • The explicit deferral of human identity, cancellation, reconnect, and runtime lifecycle.

Category

Feature

Checklist

  • I searched existing issues and found no duplicate of this capability slice.
  • I described the problem and desired behavior.

Activity

  1. added
    integration: openclaw
    area: integrations
    area: security
    needs: design
    on Aug 5, 2026
  2. self-assigned this
    on Aug 5, 2026
  3. jyaunches commented on Aug 5, 2026

    @jyaunches
    ContributorAuthor

    Maintainer decision: accepted.

    For this slice, NemoClaw will expose a private, host-side, loopback-only HTTP interface with streamed NDJSON responses.

    This HTTP/NDJSON interface is the v1 runtime adapter, not a canonical public protocol. The implementation must keep session and turn state, OpenClaw communication, and HTTP transport separated so the message, turn, identity, and event semantics remain transport-neutral. A future accepted design may add an A2A or gRPC adapter without changing agent-turn orchestration.

    Out of scope for this issue:

    • A2A or gRPC endpoints and compatibility claims
    • Agent Cards, discovery, or task persistence
    • Sandbox-to-sandbox routing

    Loopback binding does not replace authentication. The deployment-held admission credential and expiring, session-scoped grant remain required.

  4. jyaunches commented on Aug 5, 2026

    @jyaunches
    ContributorAuthor

    Maintainer decision: accepted.

    For this slice, the NemoClaw voice gateway will use the existing OpenClaw agent-gateway WebSocket interface:

    • Authenticate with operator.read and operator.write.
    • Generate the OpenClaw session key in NemoClaw.
    • Submit the committed turn with chat.send.
    • Derive the OpenClaw idempotency key from the NemoClaw turn ID.
    • Correlate and filter response events by the expected session key and run ID.

    This decision applies only to communication from the NemoClaw voice gateway to the OpenClaw agent gateway. The runtime-facing interface must not expose chat.send, OpenClaw credentials, session keys, run IDs, or native OpenClaw frames.

    The OpenClaw-specific implementation is a client within the host-side NemoClaw voice gateway. It is not an OpenClaw plugin or a separately deployed service. The voice gateway owns admission, trusted agent selection, grants, limits, turn state, normalized response events, terminal outcomes, cleanup, and redacted diagnostics. The OpenClaw client owns the WebSocket connection, OpenClaw authentication scopes, session and run correlation, native frames, and protocol compatibility.

    Do not add operator.admin or call sessions.create unless compatibility validation against the pinned OpenClaw integration shows that chat.send cannot satisfy the accepted behavior. If validation identifies that requirement, return it to maintainers before broadening privilege or adding another OpenClaw API dependency.

    A future Hermes integration must preserve the same NemoClaw committed-turn and normalized-response semantics. OpenClaw-specific identifiers and frames must remain confined to the OpenClaw client. Hermes support requires a separate accepted design decision and Hermes-specific validation; this issue does not implement or claim Hermes support.

    This slice does not require an OpenClaw plugin. An OpenClaw plugin or upstream API change is a separate design decision if validation shows that a required property cannot be enforced at the NemoClaw boundary. Examples include cancellation of active agent or tool work, an OpenClaw-native permission narrower than operator.write, or OpenClaw-side session isolation. Those properties remain outside this slice unless maintainers expand its scope.

  5. jyaunches commented on Aug 5, 2026

    @jyaunches
    ContributorAuthor

    Maintainer decision: accepted for the first functional slice.

    Issue #8378 will use one manually provisioned deployment bearer to authenticate one trusted local runtime deployment.

    For this slice:

    • The deployment supplies the bearer to the voice gateway and runtime integration layer through owner-only regular files outside the repository.
    • The deployment owns the file locations. This issue does not define a canonical path or managed distribution mechanism.
    • NemoClaw reads its file only after the exact experimental feature gate passes. It must reject symbolic links, non-owner access, malformed values, and oversized values.
    • The runtime uses the deployment bearer only to create a voice session.
    • NemoClaw returns a cryptographically random, expiring grant scoped to that voice session.
    • The runtime keeps the raw session grant in process memory. NemoClaw keeps only the value needed for constant-time grant validation and removes it on close or expiry.
    • The OpenClaw credential remains separate and NemoClaw-owned. The runtime never receives it.

    This bearer authenticates the configured deployment, not a human user. Human identity remains out of scope.

    The following work is also out of scope for #8378:

    • Managed credential creation, distribution, rotation, and recovery
    • A canonical host-to-sandbox secret-delivery mechanism
    • Multiple runtime deployments or deployment identities
    • Voice runtime installation or supervision
    • Human-user authentication

    A child issue under #8275 tracks the accepted long-term topology and credential lifecycle. This deferral keeps #8378 focused on one authenticated session and one committed turn.

  6. jyaunches commented on Aug 5, 2026

    @jyaunches
    ContributorAuthor

    Turn identity clarification

    This item does not require a separate maintainer decision. The existing requirements already establish that the runtime supplies a stable identifier, NemoClaw creates its own opaque turn and response identifiers, and a duplicate submission must not invoke the agent twice.

    Implementation should therefore treat the runtime-supplied value as an idempotency identifier scoped to the voice session. When NemoClaw first accepts it, NemoClaw generates and records the authoritative internal turn and response identifiers before invoking OpenClaw. A repeated runtime identifier is rejected as duplicate_turn without another agent invocation; a different identifier submitted while the accepted turn is running is rejected as turn_in_progress.

    Use distinct names such as commitId for the runtime value and turnId for the NemoClaw-generated value so one name does not describe two concepts. The runtime value never selects an agent, OpenClaw session, run, or forwarding destination.

    This clarifies the implementation of the existing acceptance criteria. It does not add scope or resolve the issue's remaining product and architecture decisions.

  7. jyaunches commented on Aug 5, 2026

    @jyaunches
    ContributorAuthor

    Maintainer decision: first-slice ownership and deferrals

    For #8378, accept the following boundary for the first experimental slice:

    • VoiceClaw retains WebRTC, RTVI, audio, voice activity detection, speech recognition, speech synthesis, playback, and runtime-specific UI behavior. These capabilities do not move into the NemoClaw voice gateway.
    • The gateway does not add human identity, reconnect or resume, concurrent sessions or turns, or persistent voice-session state. Later issues under [Epic] Establish an experimental voice gateway for NemoClaw agents #8275 may define those capabilities.
    • VoiceClaw continues to stop playback and suppress stale output after interruption. Authoritative response supersession, agent-generation cancellation, and durable-work cancellation remain deferred.
    • The first slice uses one foreground experimental service. It does not add VoiceClaw installation, supervision, restart, or other NemoClaw-managed runtime lifecycle behavior.

    These deferrals do not remove controls required for the first slice. The implementation must still provide deployment admission, an expiring session-scoped grant, OpenClaw credential custody, trusted agent binding, exact session and run correlation, bounded input and response handling, one terminal outcome, and cleanup on close or expiry.

    This decision establishes scope for #8378 only. It does not establish VoiceClaw, ElevenLabs, or general voice product support.

  8. removed
    needs: design
    on Aug 5, 2026
  9. added a commit that references this issue on Aug 6, 2026
    e46017a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: integrationsarea: securityintegration: openclawvoiceclaw

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions