Fix Liam waiting rotation and capability ready acknowledgement

This commit is contained in:
zenord
2026-10-15 10:41:23 +08:00
parent 654630dea5
commit f705c27eee
13 changed files with 426 additions and 34 deletions
+14 -3
View File
@@ -39,6 +39,9 @@ resolver=ast.parse((gateway_root/'persona_resolver.py').read_text())
registered=next(ast.literal_eval(n.value) for n in resolver.body if isinstance(n,ast.Assign) and
any(isinstance(t,ast.Name) and t.id=='PERSONAS' for t in n.targets))
personas=['default','lvbu']+(['liam'] if 'liam' in registered else [])
languages={p:json.loads((gateway_root/'personas'/registered[p][0]).read_bytes()).get('language','zh')
for p in personas if p!='default'}
assert all(value in ('zh','en','zh-en') for value in languages.values())
tree=ast.parse((ROOT/'scripts/check-reply-regressions.py').read_text())
nodes=[]
for node in tree.body:
@@ -122,7 +125,15 @@ for hello in hellos:
assert ack['conversation_id'] not in ids;ids.append(ack['conversation_id'])
assert ws.receive_json()['type']=='history'
assert sessions[-1]==('yangmi_fiction' if persona=='default' else persona,
'en' if persona=='liam' else 'zh',expected_voice)
LANGUAGES.get(persona,'zh'),expected_voice)
if hello.get('action_pending_pack_sha256'):
pin=hello['action_pending_pack_sha256']
ws.send_json(dict(type='client.capabilities.ready',action_protocol=1,action_pack_sha256=pin,action_kinds=['dance']))
ready=ws.receive_json()
assert ready['type']=='client.capabilities'
assert ready['action_available']==bool(pending_pin(hello,configured_packs()))
assert ready['action_pack_sha256']==(pin if pending_pin(hello,configured_packs()) else '')
assert all(k in ready for k in ('turn_id','seq','server_ms'))
assert state.busy is False, 'disconnect did not release existing gateway busy owner'
# A non-default persona stays server-locked even if a caller offers another voice/CID.
for persona in sorted({x['persona'] for x in hellos}-{'default'}):
@@ -135,6 +146,6 @@ for persona in sorted({x['persona'] for x in hellos}-{'default'}):
assert ack['voice_id']=='synthetic-'+persona and ack['conversation_id'] not in ids
ws.receive_json();ids.append(ack['conversation_id'])
assert state.busy is False
print('PASS: '+str(len(ids))+' canonical ASGI WS handshakes from actual Android HELLO; personas='+','.join(sorted({x["persona"] for x in hellos}))+'; explicit persona ignores active_profile, server-locks voice/language, fresh CID, ready/pending exact pin and disconnect busy cleanup; 0 ASR/LLM/TTS calls, synthetic-only')
'''.replace('UNREVIEWED',repr(args.unreviewed_index_sha)).replace('REVIEWED',repr(args.reviewed_index_sha))
print('PASS: '+str(len(ids))+' canonical ASGI WS handshakes from actual Android HELLO; personas='+','.join(sorted({x["persona"] for x in hellos}))+'; server_languages='+json.dumps(LANGUAGES,sort_keys=True)+'; explicit persona ignores active_profile, server-locks voice/language, fresh CID, ready/pending exact pin, pending-to-ready ACK and disconnect busy cleanup; 0 ASR/LLM/TTS calls, synthetic-only')
'''.replace('UNREVIEWED',repr(args.unreviewed_index_sha)).replace('REVIEWED',repr(args.reviewed_index_sha)).replace('LANGUAGES',repr(languages))
subprocess.run([sys.executable,'-c',runner],cwd=stage,check=True,timeout=30)