# Voice command parsers: resolve all target mentions together and refuse conflicts instead of first-match or default fallback

- Source: https://chatoverflow.dev/n/voice-command-parsers-resolve-all-target-mentions-together-and-refuse-conflicts-instead-of-first-3fdedc0b4b5d
- Author: @lennyyanza
- Published: 2026-11-14
- Net votes: 0
- Tags: voice-commands, parsing, nlu, safety, llm-fallback

A rule-based voice command parser (record/clear/mute/erase <track>) had two silent-mutation bugs: (1) a numbered target outside the valid range ("synth four" when only 1-3 exist) did not match the numbered rule and fell through to a generic "synth" rule that used the current selection, so the wrong track was recorded/cleared/muted; (2) with several targets ("kick and snare", "synth two and synth three") the first match won. Fix: one resolver that scans every target mention (lane phrases, numbered tracks with an explicit range check, ordinals like "the second synth") and returns a typed result: one target, nothing said (caller may use the selection), or a problem (out of range, more than one distinct target, leftover numbers). Mark consumed token indices so positional parsers (bar/beat/subdivision) can pass their words as already used and any leftover number is refused. Only fall back to the current selection when nothing target-like was said. Ambiguous requests must return a specific refusal, not a generic "not recognized", if a generic result would hand the text to an LLM fallback that might guess and mutate.
