From 70a044d6ad3d71d6ae7f9318b2b58a466a59a6c1 Mon Sep 17 00:00:00 2001 From: Cutshion Date: Thu, 29 Oct 2026 20:00:00 +0900 Subject: [PATCH] Understand requests for the held cup and keep a thin cup counted as held Co-Authored-By: Claude Opus 5.5 --- assistant/brain.py | 7 ++++--- assistant/lumi.py | 10 ++++++++-- robot/gripper.py | 4 ++-- tests/test_held_hand.py | 29 +++++++++++++++++++++++++---- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/assistant/brain.py b/assistant/brain.py index e508e72..3a8e939 100644 --- a/assistant/brain.py +++ b/assistant/brain.py @@ -2415,12 +2415,13 @@ REFUSE_OPEN = ("I won't open my hand while I'm holding something: it would fall. _GV = r"(?:give|gib|givv?e?|gi+ve|gve|hand|pass|deliver|bring)" _GIVE_TO = (r"(?:me|us|him|her|them|my \w+|this \w+|that \w+|the \w+(?: \w+)?|(?:the )?(?:left|right) (?:one|person|guy|lady))") GIVE_HELD_EN = re.compile( - rf"\b{_GV}\s+(?:{_GIVE_TO}\s+)?(?:{_IT}|that one|this one|the (?:{_OBJ})s?|(?:(?:{_COL})\s+)?(?:{_OBJ})s?|what you(?:'?re| are)? hold(?:ing)?)\b" + rf"\b{_GV}\s+(?:{_GIVE_TO}\s+)?(?:{_IT}|that one|this one|the (?:{_OBJ})s?|(?:(?:a|an|one)\s+)?(?:(?:{_COL})\s+)?(?:{_OBJ})s?|what you(?:'?re| are)? hold(?:ing)?)\b" r"(?!\s+(?:a|an|up|try|rest|go|shot|chance|break)\b)" rf"|^\W*(?:that|this|the \w+) one to me\b|\b{_GV}\s+(?:{_IT}\s+)?(?:over|back)\b|\b{_GV}\s+(?:{_IT}\s+)?to\s+(?!the (?:\w+ )?(?:table|chair|desk|floor)\b)\w" rf"|\b{_GV}\s+(?:me|us)\b(?!\s+(?:a|an|some|your|his|her|their|directions|time|space|the (?!(?:{_OBJ})s?\b|thing|one)\w+)\b)" rf"|\b(?:{_GV}|passed|handed)\s+(?:\w+\s+){{0,3}}?to (?:me|us)\b|\b(?:pop|drop|put|release|let go of|place)\b.*\b(?:in|into) my hands?\b|\brelease it to me\b" r"|(?