#891·fonoster

[Bug] Autopilot ignores allowUserBargeIn during the greeting and the idle message

Author: psandersCreated Sep 10, 2026Updated Sep 10, 2026
Labelsbug

Summary

With allowUserBargeIn: false, the autopilot still lets the caller interrupt the first message and the idle prompt, because the greeting and announcingIdleTimeout states accept SPEECH_START without the barge-in guard.

Steps to Reproduce

  1. Configure an assistant with conversationSettings.allowUserBargeIn: false and a long firstMessage.
  2. Call in and talk (or make background noise) while the greeting is playing.
  3. Observe: playback is cut (interruptPlayback runs voice.stopSpeech()), same as with barge-in enabled.
  4. Same with idleOptions.message while it is being announced.

Expected Behavior

When barge-in is disabled, the assistant finishes the greeting and the idle prompt uninterrupted, consistent with processingUserRequest and waitingForSpeechTimeout, which guard SPEECH_START with context.allowUserBargeIn.

Actual Behavior

mods/autopilot/src/machine/machine.ts: both states transition to listeningToUser on SPEECH_START unconditionally. This predates #890 (the old machine sat in idle, which was also unguarded), but that PR made the two "assistant is speaking" states explicit, so it is the right place to honor the setting.

Note for the fix: a bare guard is not enough. idle only listens for SPEECH_START, so if the caller answers "yes, I'm here" during the idle prompt and the event is dropped, the machine sits silent until the next timeout. The announcement's onDone (and possibly the greeting's) should route to listeningToUser, or idle should also accept SPEECH_RESULT, so speech that started during playback is still processed.

Found by code review of #890.

Priority

P2