fix(app): a wake word said alone waits for what the speaker says next

A pause after the name ("자비스, ... 지금 몇 시야?") is longer than the
worker's 300 ms end silence, so the wake word ended its own utterance:
Jarvis answered the bare name and ignored the question that followed (no
wake word). Found on real Discord. A voice utterance that is only a wake
word is now joined to the same speaker's next final when that utterance
is running or starts within call.followUpMs (default 1500); otherwise the
wake word alone is the request after that time. Stops drop it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 09:44:06 +09:00
parent 9ff307d7fe
commit bd2eb49e3d
5 changed files with 149 additions and 11 deletions

View File

@@ -242,6 +242,7 @@ fn parse_call(raw: &Map<String, Value>, wake_words: &[String], d: &CallSettings)
designated_only: get_bool(call, "designatedOnly", "call", d.designated_only)?,
designated_no_wake_word: get_bool(call, "designatedNoWakeWord", "call", d.designated_no_wake_word)?,
stop_words,
follow_up: get_ms(call, "followUpMs", "call", d.follow_up, 5000)?,
},
chat_wake_words,
))
@@ -476,7 +477,8 @@ mod tests {
let s = parse_settings(&json!({
"voice": {"wakeWords": ["자비스", "javis"]},
"call": {"similarity": 0.3, "mode": "addressed", "designated": [ID], "designatedOnly": true,
"designatedNoWakeWord": true, "stopWords": ["멈춰", " "], "chatWakeWords": ["봇"]},
"designatedNoWakeWord": true, "stopWords": ["멈춰", " "], "chatWakeWords": ["봇"],
"followUpMs": 2500},
"response": {"policy": "important", "queueMax": 3, "collectMs": 500, "settleMs": 0,
"priorities": {ID: 2}}
})).unwrap();
@@ -487,6 +489,7 @@ mod tests {
assert!(s.call.designated_only && s.call.designated_no_wake_word);
assert_eq!(s.call.stop_words, vec!["멈춰"]);
assert_eq!(s.chat_wake_words, Some(vec!["봇".to_string()]));
assert_eq!(s.call.follow_up, Duration::from_millis(2500));
assert_eq!(s.response.kind, PolicyKind::Important);
assert_eq!(s.response.queue_max, 3);
assert_eq!(s.response.collect, Duration::from_millis(500));
@@ -499,6 +502,7 @@ mod tests {
(json!({"call": {"similarity": 0.9}}), "call.similarity"),
(json!({"call": {"mode": "sometimes"}}), "call.mode"),
(json!({"call": {"designated": ["1"]}}), "call.designated"),
(json!({"call": {"followUpMs": 6000}}), "call.followUpMs"),
(json!({"response": {"policy": "random"}}), "response.policy"),
(json!({"response": {"queueMax": 0}}), "response.queueMax"),
(json!({"response": {"collectMs": 5000}}), "response.collectMs"),