aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_assistant.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 12:45:52 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 12:45:52 +0100
commitc30385b92ff767f8aaff58bf0bc1e5c42ce9036c (patch)
tree724f3fca1eacf2ba2cd3d7046befd8b464e42e97 /tests/test_assistant.py
parentc8f5a1e68d3294d4e1c7be3c386f3cc538eeb7af (diff)
downloaddeck-it-c30385b92ff767f8aaff58bf0bc1e5c42ce9036c.tar.gz
deck-it-c30385b92ff767f8aaff58bf0bc1e5c42ce9036c.zip
fix(assistant): voice-only tab, tools in an overlay, silent clips dropped
The first voice question on the tablet was a 0.66 s silent clip: the mic gave no feedback until the next poll, an extra tap made a near-empty recording, and the model invented a question from the silence. The mic now turns red on the tap itself, and a clip whose loudest sample is under 1500 (room noise measured ~260, speech 15000+) is not sent. Typing happens on the PC, so the text field, send button and the ask action are gone; the bar is a large mic and a stop icon. The presets and ops move into an overlay opened from the header, so the transcript gets the screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_assistant.py')
-rw-r--r--tests/test_assistant.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_assistant.py b/tests/test_assistant.py
index 7ea782b..0280e0c 100644
--- a/tests/test_assistant.py
+++ b/tests/test_assistant.py
@@ -199,19 +199,18 @@ class Client(Base):
self.assertTrue(until(lambda: {"type": "models"} in self.d.got))
self.assertEqual(self.m.state()["model"], "m1")
- def test_ask_carries_the_picked_model(self):
+ def test_voice_carries_the_picked_model(self):
self.d.push({"type": "models", "items": [{"id": "ears", "status": "loaded", "cloud": False,
"inputs": ["audio"]}]})
self.assertTrue(until(lambda: self.m.state()["models"]))
self.m.actions["model"]({"id": "ears"})
- self.m.actions["ask"]({"text": "hi"})
- self.assertTrue(until(lambda: {"type": "ask", "text": "hi", "model": "ears"} in self.d.got))
+ self.m.actions["voice"](b"RIFF\x24\x00\x00\x00WAVE" + b"\x00" * 32)
+ self.assertTrue(until(lambda: {"type": "ask", "text": "", "audio": str(a.VOICE),
+ "model": "ears"} in self.d.got))
self.assertTrue(self.m.state()["hears"])
def test_bad_input_is_refused(self):
- for bad in ({}, {"text": ""}, {"text": 3}):
- with self.assertRaises(a.ModuleError):
- self.m.actions["ask"](bad)
+ self.assertNotIn("ask", self.m.actions) # no keyboard on the tablet
with self.assertRaises(a.ModuleError):
self.m.actions["model"]({"id": "nope"})