Skip to content

noise-cancellation-node crashes the agent process on macOS arm64 at session start (uncaught C++ exception in Nc::~Nc) #2003

Description

@dtran26

Summary

Passing NoiseCancellation() from @livekit/noise-cancellation-node as inputOptions.noiseCancellation hard-crashes the agent job process on macOS arm64 immediately after room connection, with an uncaught native (C++) exception. Nothing surfaces to JS, so the failure can't be caught or degraded gracefully — the process aborts and the live call drops to dead air.

Environment

  • @livekit/noise-cancellation-node 0.1.10
  • @livekit/agents 1.5.0, @livekit/rtc-node 0.13.30
  • Node v24.11.1, macOS 15.4.1 (arm64, M-series), worker running locally in dev mode against a LiveKit Cloud project
  • Telephony agent: SIP participant (Twilio inbound trunk), AgentSession with LiveKit Inference STT/LLM + ElevenLabs TTS

Reproduction

import { NoiseCancellation } from '@livekit/noise-cancellation-node';

await session.start({
  agent,
  room,
  inputOptions: {
    audioEnabled: true,
    participantIdentity,
    noiseCancellation: NoiseCancellation(),
  },
});

Dial in via SIP. The job process dies right after the room connects, before the agent speaks:

[21:05:55.767] DEBUG (54972): connection state changed
    state: 1
Nc::~Nc: Exception caught while destroying the session
libc++abi: terminating due to uncaught exception of type std::runtime_error

The job runner then logs Room disconnected while waiting for participant when the next job starts. Reproduced deterministically on 2/2 inbound PSTN calls; removing the noiseCancellation option fully resolves it.

The log line order suggests the NC session fails during init, and the error is then re-thrown from the Nc destructor during cleanup, which terminates the process.

Expected behavior

  1. If macOS arm64 isn't a supported platform for this package, a load-time error would be much kinder than a mid-call process abort — the npm package installs cleanly, so there's no signal until a live call dies.
  2. Regardless of platform support: NC init failures should surface as a JS error (ideally with audio passed through unfiltered) instead of an uncatchable native terminate. A crashed agent process takes the live call down with it.

Happy to provide a full debug log or test a patched build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions