feat(mobile): correlate voice tasks and recover results on reconnect

This commit is contained in:
yilsem committed 2026-09-08 21:00:28 +03:00
1 parent 9f9f3226a1
commit b66daed07a
17 files changed
+308 -48

No files matched your search

@@ -29,6 +29,7 @@ def test_mobile_reads_and_submits_through_real_runtime(tmp_path, monkeypatch):
def do_POST(self):
body = json.loads(self.rfile.read(int(self.headers['Content-Length'])))
calls.append(body)
time.sleep(1) # Keep the first turn busy while two separate tasks queue.
message = {'role': 'assistant', 'content': 'MOBIL_RUNTIME_OK'}
response = {'id': 'fixture', 'object': 'chat.completion', 'created': 1,
'model': 'mobile-fixture', 'choices': [{'index': 0, 'message': message, 'finish_reason': 'stop'}],
@@ -79,5 +80,6 @@ def test_mobile_reads_and_submits_through_real_runtime(tmp_path, monkeypatch):
assert delivered
history = db.get_messages('mobile-integration-session')
assert sum('MOBIL_GOREV_20260908' in str(row.get('content')) for row in history if row['role'] == 'user') == 1
assert sum('MOBIL_SIRA_20260908' in str(row.get('content')) for row in history if row['role'] == 'user') == 2
finally:
server.should_exit = True; thread.join(10); bound.close(); provider.shutdown(); provider.server_close(); db.close()