From 48724cac151880d851aa43f14b5551b8517c0174 Mon Sep 17 00:00:00 2001 From: Cutshion Date: Thu, 22 Oct 2026 17:40:51 +0900 Subject: [PATCH] Follow: clip-mic speech counts as the followed person when follow was started through it Co-Authored-By: Claude Opus 5.5 --- assistant/lumi.py | 4 ++++ tests/test_follow_listen.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/assistant/lumi.py b/assistant/lumi.py index ae288b1..f03deed 100644 --- a/assistant/lumi.py +++ b/assistant/lumi.py @@ -1985,6 +1985,7 @@ class Lumi: f"loudest {ears.last.get('peak')}{', ' + ears.last_stt['dropped'] if ears.last_stt.get('dropped') else ''})") return False from tasks import follow + self.last_u = u # follow_me: was "follow me" said into the clip mic? if self.follow_filter(text, u): # following: only the followed person is listened to return True if not follow.running(): # following: the head stays on the followed person @@ -2017,6 +2018,8 @@ class Lumi: """While following: does the voice come from the person followed (the sound direction against their angle now, within FOLLOW_VOICE_DEG)? False when it can't tell (not calibrated, unsure, not seen).""" from tasks import follow + if getattr(u, "source", None) == "clip": # no direction: theirs if "follow me" came through it too + return getattr(self, "follow_by_clip", False) want = follow.followed_angle() if want is None or u is None or getattr(u, "mics", None) is None: return False @@ -2653,6 +2656,7 @@ class Lumi: self.fetch_say(*why) return self.current, track.greeted = track, True + self.follow_by_clip = getattr(getattr(self, "last_u", None), "source", None) == "clip" log(f"FOLLOW person #{track.id} at {track.distance:.2f} m {track.angle:+.0f} deg") mouth.say("Okay, I'll follow you. Say stop when you want me to stay." if en else "네, 따라갈게요. 멈추려면 멈춰라고 하세요.") diff --git a/tests/test_follow_listen.py b/tests/test_follow_listen.py index e6e4589..9d81519 100644 --- a/tests/test_follow_listen.py +++ b/tests/test_follow_listen.py @@ -98,6 +98,13 @@ assert L.follow_stop("stop") and "follow stop" in done, done for word in ("stop", "Stop it!", "멈춰", "wait"): L = fresh(word, -70.0) assert L.talk_turn() and "follow stop" in done and ("act", "stop") in done and heard == [], (word, done) +# the clip mic (no direction): the followed person's when "follow me" came through it, else unsure (dropped) +for by_clip in (True, False): + L = fresh("How far am I from you?", -70.0) + L.follow_by_clip = by_clip + lumi.ears.listen = lambda **k: ("How far am I from you?", type("Clip", (), {"source": "clip", "mics": None, + "seconds": 1.2, "during_speech": False})()) + assert L.talk_turn() and heard == (["How far am I from you?"] if by_clip else []), (by_clip, heard) # not following: today's rule, anyone is heard and looked at run["on"] = False L = fresh("What time is it?", -70.0)