Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

voice: ask back like a person, caption follows the island, never stuck deaf

Claudecdbaf175dcba
diff --git a/NotchBuddy/Resources/Localizable.xcstrings b/NotchBuddy/Resources/Localizable.xcstrings
index d1dfc2d8..e9915152 100644
--- a/NotchBuddy/Resources/Localizable.xcstrings
+++ b/NotchBuddy/Resources/Localizable.xcstrings
@@ -24516,6 +24516,266 @@
}
}
}
+ },
+ "voice.ask-repeat": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "عفوًا، هل يمكنك التكرار؟"
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "দুঃখিত, আবার বলবে?"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Sorry, can you say that again?"
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Perdona, ¿puedes repetir?"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pardon, tu peux répéter ?"
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "माफ़ करना, फिर से बोलोगे?"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Maaf, bisa diulang?"
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Desculpa, pode repetir?"
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Прости, можешь повторить?"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "抱歉,可以再说一遍吗?"
+ }
+ }
+ }
+ },
+ "voice.ask-which-pill-add": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "أي حبة تريد أن تضيف؟"
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "কোন পিল যোগ করবে?"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Which pill do you want to add?"
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "¿Qué píldora quieres añadir?"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Quelle pilule tu veux ajouter ?"
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "कौन-सी पिल जोड़नी है?"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pil mana yang mau ditambahkan?"
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Qual pílula você quer adicionar?"
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Какую пилюлю добавить?"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "要添加哪个胶囊?"
+ }
+ }
+ }
+ },
+ "voice.ask-which-pill-remove": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "أي حبة تريد أن تزيل؟"
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "কোন পিল সরাবে?"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Which pill do you want to remove?"
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "¿Qué píldora quieres quitar?"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Quelle pilule tu veux retirer ?"
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "कौन-सी पिल हटानी है?"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pil mana yang mau dihapus?"
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Qual pílula você quer remover?"
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Какую пилюлю убрать?"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "要移除哪个胶囊?"
+ }
+ }
+ }
+ },
+ "voice.ask-which-playlist": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "أي قائمة تشغيل؟"
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "কোন প্লেলিস্ট?"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Which playlist?"
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "¿Qué playlist?"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Quelle playlist ?"
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "कौन-सी प्लेलिस्ट?"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Playlist yang mana?"
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Qual playlist?"
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Какой плейлист?"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "哪个播放列表?"
+ }
+ }
+ }
}
},
"version": "1.0"
diff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swift
index e79635fa..a90b54d6 100644
--- a/NotchBuddy/Sources/App/IslandWindowController.swift
+++ b/NotchBuddy/Sources/App/IslandWindowController.swift
@@ -1465,8 +1465,16 @@ extension IslandWindowController {
let tActionEnd = Date()
let actionMs = Int(tActionEnd.timeIntervalSince(tParseEnd) * 1000)
+ // Incomplete phrase ("je veux que tu ajoutes…", nothing named): ask which pill
+ // and listen for it, instead of guessing or saying "pas compris".
+ var askedBack = false
+ if case .unknown = intent, let ask = runner.askIfIncomplete(transcript) {
+ result = ask
+ askedBack = true
+ }
+
// If unknown, try VoiceBrain (macOS 26 + Apple Intelligence) with streaming TTS.
- if case .unknown = intent {
+ if case .unknown = intent, !askedBack {
let tBrain0 = Date()
let brainWarm = VoiceBrain.shared.isSessionReady
var brainUsed = false
@@ -1545,9 +1553,21 @@ extension IslandWindowController {
// Mid-conversation, a phrase with no command in it (talking to someone else,
// "on s'en fout c'est"…) is dropped silently: no dizzy Mochi, no "pas compris".
// Two in a row end the conversation.
- if isInConversation, case .unknown = effectiveIntent, result.outcome == .failure {
- appendAppLog("nb.log", "[Voice] answer had no command in it, ignored")
- closeVoiceTurn()
+ if case .unknown = effectiveIntent, result.outcome == .failure {
+ if isInConversation {
+ // Second miss (or noise while waiting for an answer): stop there.
+ appendAppLog("nb.log", "[Voice] answer had no command in it, ignored")
+ closeVoiceTurn()
+ return
+ }
+ // First miss right after "OK Coucou": ask once, like a person would
+ // ("Pardon, tu peux répéter ?"), then listen for the repeat.
+ let again = VoiceActionResult(
+ outcome: .success,
+ message: VoiceActionRunner.localizedString("voice.ask-repeat", locale: runner.commandLocale))
+ VoiceCaptionManager.shared.appendResponse(again.message)
+ AppState.shared.voiceResult = again
+ speakAndContinueConversation(again)
return
}
diff --git a/NotchBuddy/Sources/App/Voice/IntentParser.swift b/NotchBuddy/Sources/App/Voice/IntentParser.swift
index 2047cb5e..0ff29341 100644
--- a/NotchBuddy/Sources/App/Voice/IntentParser.swift
+++ b/NotchBuddy/Sources/App/Voice/IntentParser.swift
@@ -56,6 +56,26 @@ enum IntentParser {
return .pillReplace(old: old, new: new)
}
+ // ── 0d. "j'ai envie d'écouter du Drake", "je veux écouter Daft Punk" ──
+ if let i = fwords.lastIndex(where: { $0 == "ecouter" || $0 == "ecoute" }),
+ i > 0 || fwords.count > 1 {
+ let articles: Set<String> = ["du", "de", "des", "la", "le", "les", "l", "d", "un", "une"]
+ var restN = Array(fwords[(i + 1)...])
+ var restR = Array(frawWords[min(i + 1, frawWords.count)...])
+ while let f = restN.first, articles.contains(f) {
+ restN.removeFirst(); if !restR.isEmpty { restR.removeFirst() }
+ }
+ if !restN.isEmpty {
+ if musicGenericWords.contains(restN.joined(separator: " ")) {
+ return .musicPlay(target: nil)
+ }
+ if restN != ["ca"] && restN != ["moi"] {
+ let raw = restR.joined(separator: " ")
+ return .musicPlaySearch(name: raw.isEmpty ? restN.joined(separator: " ") : raw)
+ }
+ }
+ }
+
// ── 1. Explicit music-only patterns ──────────────────────────────────
if matchesAny(fwords, in: pausePrefixes) { return .musicPause }
if matchesAny(fwords, in: nextPrefixes) { return .musicNext }
@@ -135,6 +155,13 @@ enum IntentParser {
if !clean.isEmpty {
return .musicPlayPlaylist(name: cleanRaw.isEmpty ? clean : cleanRaw)
}
+ // "lance ma playlist" with no name: the runner asks which one.
+ return .musicPlayPlaylist(name: "")
+ }
+ // "tu peux lancer ma playlist" (the trigger needs a name after it): ask which one.
+ if fwords.last == "playlist" || fwords.last == "playlists",
+ fwords.contains(where: { ["lance", "mets", "met", "joue", "balance", "play", "start"].contains($0) }) {
+ return .musicPlayPlaylist(name: "")
}
// ── 8. pillMain triggers (setMain-only verbs) ────────────────────────
@@ -585,6 +612,10 @@ enum IntentParser {
/// Polite prefix sequences stripped from the START of the word array (longest first).
private static let politenessPrefixes: [[String]] = [
+ // "je veux que tu ajoutes…", "j'aimerais que tu…", "(il) faut que tu…"
+ // ("il" is already a filler, so "il faut que tu" arrives as "faut que tu")
+ ["je", "veux", "que", "tu"], ["je", "voudrais", "que", "tu"],
+ ["j", "aimerais", "que", "tu"], ["faut", "que", "tu"],
["est", "ce", "que", "tu", "peux"],
["est", "ce", "que", "tu", "pourrais"],
["tu", "peux"],
@@ -619,6 +650,21 @@ enum IntentParser {
"baisser": "baisse",
"couper": "coupe",
"arreter": "arrete",
+ // 2nd person / subjunctive after "je veux que tu …"
+ "ajoutes": "ajoute",
+ "rajoutes": "rajoute",
+ "enleves": "enleve",
+ "retires": "retire",
+ "supprimes": "supprime",
+ "mettes": "mets",
+ "lances": "lance",
+ "actives": "active",
+ "desactives": "desactive",
+ "remplaces": "remplace",
+ // "démarre Apple Music" = "lance Apple Music"
+ "demarrer": "lance",
+ "demarre": "lance",
+ "demarres": "lance",
]
private static let pausePrefixes: [[String]] = [
diff --git a/NotchBuddy/Sources/App/Voice/VoiceActionRunner.swift b/NotchBuddy/Sources/App/Voice/VoiceActionRunner.swift
index 2e4bef9b..0139d4f1 100644
--- a/NotchBuddy/Sources/App/Voice/VoiceActionRunner.swift
+++ b/NotchBuddy/Sources/App/Voice/VoiceActionRunner.swift
@@ -165,6 +165,9 @@ final class VoiceActionRunner {
return .init(outcome: .success,
message: fmt.contains("%@") ? String(format: fmt, name) : name)
+ case .musicPlayPlaylist(let name) where name.trimmingCharacters(in: .whitespaces).isEmpty:
+ return ask(.whichPlaylist, "voice.ask-which-playlist")
+
case .musicPlayPlaylist(let name):
if !music.isMusicRunning && !music.isSpotifyRunning {
await music.launchAndPlay()
@@ -272,6 +275,18 @@ final class VoiceActionRunner {
return ok("voice.question-cancelled")
}
+ // A playlist name is free text, not a pill.
+ if case .whichPlaylist = pending.kind {
+ var name = transcript.trimmingCharacters(in: .whitespacesAndNewlines)
+ if case .musicPlayPlaylist(let n) = IntentParser.parse(transcript, pills: availablePills),
+ !n.isEmpty { name = n }
+ for prefix in ["la playlist ", "ma playlist ", "playlist ", "the playlist "]
+ where name.lowercased().hasPrefix(prefix) {
+ name = String(name.dropFirst(prefix.count))
+ }
+ return await run(.musicPlayPlaylist(name: name), availablePills: availablePills)
+ }
+
guard let entity = Self.answerEntity(transcript, active: pills.activeIds(),
availablePills: availablePills) else {
// Not understood: ask once more, then give up.
@@ -285,6 +300,11 @@ final class VoiceActionRunner {
}
switch pending.kind {
+ case .whichPlaylist:
+ return fail("voice.unknown") // handled above
+ case .whichPill(let add):
+ return await run(add ? .pillAdd(id: entity) : .pillRemove(id: entity),
+ availablePills: availablePills)
case .removeWhich(let toAdd):
if pills.activeIds().contains(entity) {
pills.toggleIntegration(entity)
@@ -301,6 +321,25 @@ final class VoiceActionRunner {
}
}
+ /// "Je veux que tu ajoutes" (no pill named) → asks which pill, and listens for it.
+ /// Returns nil when the phrase has no add/remove verb either.
+ func askIfIncomplete(_ transcript: String) -> VoiceActionResult? {
+ let words = Set(IntentParser.normalise(transcript).split(separator: " ").map(String.init))
+ let addVerbs: Set<String> = ["ajoute", "ajoutes", "ajouter", "rajoute", "rajoutes", "rajouter",
+ "active", "actives", "activer", "add"]
+ let removeVerbs: Set<String> = ["enleve", "enleves", "enlever", "retire", "retires", "retirer",
+ "supprime", "supprimes", "supprimer", "vire", "virer", "remove"]
+ if !words.isDisjoint(with: removeVerbs) { return ask(.whichPill(add: false), "voice.ask-which-pill-remove") }
+ if !words.isDisjoint(with: addVerbs) { return ask(.whichPill(add: true), "voice.ask-which-pill-add") }
+ return nil
+ }
+
+ private func ask(_ kind: PendingVoiceQuestion.Kind, _ key: String) -> VoiceActionResult {
+ let text = Self.localizedString(key, locale: commandLocale)
+ pendingQuestion = PendingVoiceQuestion(kind: kind, text: text)
+ return .init(outcome: .question(text: text), message: text)
+ }
+
/// The pill named in an answer, whether it is a bare name ("Stripe") or a sentence
/// ("je retire la pilule Stripe", "enlève GitHub", "plutôt Vercel").
/// Active pills win when several names could match.
diff --git a/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift b/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift
index 232028f1..91127900 100644
--- a/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift
+++ b/NotchBuddy/Sources/App/Voice/VoiceCaptionManager.swift
@@ -55,6 +55,15 @@ final class VoiceCaptionManager {
MainActor.assumeIsolated { self?.state.liveLine = t }
}
.store(in: &subs)
+ // Follow the island: it can open or close while I am talking.
+ let app = AppState.shared
+ app.$mode.combineLatest(app.$view)
+ .removeDuplicates { $0 == $1 }
+ .receive(on: RunLoop.main)
+ .sink { [weak self] _ in
+ MainActor.assumeIsolated { self?.reposition(animated: true) }
+ }
+ .store(in: &subs)
engine.$isListeningForCommand
.removeDuplicates()
.receive(on: RunLoop.main)
@@ -76,7 +85,8 @@ final class VoiceCaptionManager {
hideTask = nil
if panel == nil { _buildPanel() }
- _position(on: screen, notchHeight: notchHeight)
+ self.screen = screen
+ reposition(animated: false)
guard let p = panel else { return }
if !p.isVisible { p.alphaValue = 0; p.orderFrontRegardless() }
@@ -147,13 +157,31 @@ final class VoiceCaptionManager {
panel = p
}
- private func _position(on screen: NSScreen, notchHeight: CGFloat) {
- guard let p = panel else { return }
+ private var screen: NSScreen?
+
+ /// Just under the visible island (compact, open or hidden), centred on it.
+ /// The island window is a fixed panel: its visible height comes from islandSize().
+ private func reposition(animated: Bool) {
+ guard let p = panel, let screen else { return }
+ let app = AppState.shared
+ let (_, fixedH) = islandSize(mode: app.mode, view: app.view, progress: app.uploadProgress,
+ nw: app.notchWidth, nh: app.notchHeight)
+ var islandH = fixedH
+ if app.mode == .expanded && app.view == .prompt {
+ islandH = min(300, 240 + CGFloat(app.chatHistory.count) * 40)
+ }
+ let visibleH = max(islandH, app.notchHeight)
let sf = screen.frame
- let x = sf.midX - captionWidth / 2
- // AppKit origin is bottom-left; notch is at top of screen
- let y = sf.maxY - notchHeight - notchGap - captionHeight
- p.setFrameOrigin(NSPoint(x: x, y: y))
+ let origin = NSPoint(x: sf.midX - captionWidth / 2,
+ y: sf.maxY - visibleH - notchGap - captionHeight)
+ if animated && p.isVisible {
+ NSAnimationContext.runAnimationGroup { ctx in
+ ctx.duration = 0.25
+ p.animator().setFrameOrigin(origin)
+ }
+ } else {
+ p.setFrameOrigin(origin)
+ }
}
private func _fadeOut() {
diff --git a/NotchBuddy/Sources/App/Voice/VoiceEngine.swift b/NotchBuddy/Sources/App/Voice/VoiceEngine.swift
index 6496773f..8423da9c 100644
--- a/NotchBuddy/Sources/App/Voice/VoiceEngine.swift
+++ b/NotchBuddy/Sources/App/Voice/VoiceEngine.swift
@@ -265,7 +265,7 @@ final class VoiceEngine: ObservableObject {
a.onVoiceStart = { [weak self] in
guard let self else { return }
- guard !VoiceSpeaker.shared.isSpeaking else {
+ guard !VoiceSpeaker.shared.isBusy else {
appendAppLog("nb.log", "[Voice] vad start ignored (speaker active)")
return
}
@@ -531,7 +531,7 @@ final class VoiceEngine: ObservableObject {
private func commandUpdate(_ command: String) {
// Semi-duplex: ignore updates while Coucou is speaking.
- guard !VoiceSpeaker.shared.isSpeaking else { return }
+ guard !VoiceSpeaker.shared.isBusy else { return }
commandTranscript = command
let wc = command.split(separator: " ").count
if wc > lastWordCount {
diff --git a/NotchBuddy/Sources/App/Voice/VoiceIntent.swift b/NotchBuddy/Sources/App/Voice/VoiceIntent.swift
index b5610ed6..4a0150ae 100644
--- a/NotchBuddy/Sources/App/Voice/VoiceIntent.swift
+++ b/NotchBuddy/Sources/App/Voice/VoiceIntent.swift
@@ -61,6 +61,8 @@ struct VoiceActionResult: Equatable {
struct PendingVoiceQuestion {
enum Kind {
case removeWhich(toAdd: String) // 4-pill limit: which pill to remove to add X?
+ case whichPill(add: Bool) // "ajoute…" with no pill named: which one?
+ case whichPlaylist // "lance ma playlist": which playlist?
}
let kind: Kind
let text: String
diff --git a/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift b/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift
index b7a3c718..d8136288 100644
--- a/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift
+++ b/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift
@@ -49,10 +49,19 @@ final class VoiceSpeaker: NSObject, AVSpeechSynthesizerDelegate, @unchecked Send
func stop() {
queue.removeAll()
- guard isSpeaking else { return }
+ // Reset now: if the synthesizer never reports the cancel (stopped before the
+ // utterance really started), isSpeaking would stay true and the mic would
+ // ignore everything until relaunch.
+ currentUtterance = nil
+ isSpeaking = false
synth.stopSpeaking(at: .immediate)
}
+ /// What the mic gate should use: the synthesizer's own state (or sentences still
+ /// queued), never our flag alone, so a missed delegate callback cannot leave
+ /// Coucou deaf.
+ var isBusy: Bool { synth.isSpeaking || !queue.isEmpty }
+
// MARK: - Private
private func _enqueueAndPlay(text: String, locale: Locale?) {
diff --git a/tests/IntentParserTests.swift b/tests/IntentParserTests.swift
index ea148436..63be1574 100644
--- a/tests/IntentParserTests.swift
+++ b/tests/IntentParserTests.swift
@@ -302,6 +302,16 @@ enum IntentParserTests {
check("bon alors ajoute Notion",
parse("bon alors ajoute Notion", pills: pills), .pillAdd(id: "integration_notion"))
check("On s'en fout c'est", parse("On s'en fout c'est", pills: pills), .unknown)
+ check("Je veux que tu ajoutes la pilule Gemini",
+ parse("Je veux que tu ajoutes la pilule Gemini", pills: pills), .pillAdd(id: "agent_gemini"))
+ check("il faut que tu enlèves Stripe",
+ parse("il faut que tu enlèves Stripe", pills: pills), .pillRemove(id: "integration_stripe"))
+ checkSearch("OK tu peux démarrer Apple Music j'ai envie d'écouter du Drake",
+ parse("OK tu peux démarrer Apple Music j'ai envie d'écouter du Drake", pills: pills), "drake")
+ check("j'ai envie d'écouter de la musique",
+ parse("j'ai envie d'écouter de la musique", pills: pills), .musicPlay(target: nil))
+ check("tu peux lancer ma playlist",
+ parse("tu peux lancer ma playlist", pills: pills), .musicPlayPlaylist(name: ""))
checkMultiAction("Enlève la pilule GT et mets Stripe à la place",
parseMulti("Enlève la pilule GT et mets Stripe à la place"),
[.pillRemove(id: "integration_github"), .pillAdd(id: "integration_stripe")])
diff --git a/tests/VoiceActionRunnerTests.swift b/tests/VoiceActionRunnerTests.swift
index c5eaf6e4..9b445612 100644
--- a/tests/VoiceActionRunnerTests.swift
+++ b/tests/VoiceActionRunnerTests.swift
@@ -193,6 +193,28 @@ enum VoiceActionRunnerTests {
check("second unclear answer → failure", unclear2.outcome, .failure)
check("question dropped after second miss", runner.pendingQuestion == nil, true)
+ // Incomplete phrase → asks which pill, then uses the answer
+ pills_.active = ["integration_github"]
+ pills_.calls = []
+ let incomplete = runner.askIfIncomplete("Modifie-moi les piles je veux que tu ajoutes")
+ if case .question = incomplete?.outcome { print("✓ incomplete add → question"); pass += 1 }
+ else { print("✗ incomplete add — got \(String(describing: incomplete))"); fail += 1 }
+ let pick = await runner.handleAnswer("Gemini", availablePills: pills)
+ check("which pill answer → success", pick.outcome, .success)
+ check("which pill answer → gemini added", pills_.calls.contains("toggle:agent_gemini"), true)
+ check("no question for a phrase without verb", runner.askIfIncomplete("ouais ça va") == nil, true)
+ let incompleteRemove = runner.askIfIncomplete("enlève-moi la")
+ if case .question = incompleteRemove?.outcome { print("✓ incomplete remove → question"); pass += 1 }
+ else { print("✗ incomplete remove"); fail += 1 }
+ runner.pendingQuestion = nil
+
+ // Playlist without a name → asks which one
+ let noName = await runner.run(.musicPlayPlaylist(name: ""), availablePills: pills)
+ if case .question = noName.outcome { print("✓ playlist without name → question"); pass += 1 }
+ else { print("✗ playlist without name — got \(noName.outcome)"); fail += 1 }
+ check("playlist question pending", runner.pendingQuestion != nil, true)
+ runner.pendingQuestion = nil
+
// ── Pills: add multiple ───────────────────────────────────────────────
pills_.active = ["integration_github"]
pills_.calls = []