[Bugfix][Full Duplex] Preserve shared runtime compatibility
Signed-off-by: Sy03 <1370724210@qq.com>
This commit is contained in:
1 parent
6e720e49e7
commit
b103e65efc
6 files changed
+58
-18
No files matched your search
@@ -5439,6 +5439,33 @@ async def test_minicpmo_native_duplex_open_unsupported_fails_session_create():
|
||||
assert ws.sent[0]["runtime_control"]["unsupported_count"] == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_native_runtime_rejects_server_vad_without_barge_in(monkeypatch: pytest.MonkeyPatch):
|
||||
engine = FakeEngineClient()
|
||||
handler = OmniDuplexSessionHandler(
|
||||
chat_service=FakeChatService(engine),
|
||||
config_timeout_s=0.1,
|
||||
idle_timeout_s=1,
|
||||
)
|
||||
capabilities = DuplexCapabilities.minicpmo45_native()
|
||||
capabilities.supports_barge_in = False
|
||||
monkeypatch.setattr(
|
||||
handler._serving_runtime_adapter,
|
||||
"capabilities",
|
||||
lambda *, max_sessions: capabilities,
|
||||
)
|
||||
event = _native_session_create("sid-native-no-barge-in")
|
||||
event["session"]["overlap_policy"] = "barge_in_on_speech"
|
||||
ws = TimedWebSocket()
|
||||
ws.put(event)
|
||||
|
||||
await handler.handle_session(ws)
|
||||
|
||||
assert ws.sent_types() == ["error"]
|
||||
assert ws.sent[0]["code"] == "unsupported_turn_detection"
|
||||
assert engine.opened == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_minicpmo_native_duplex_rejects_engine_without_fence_contract():
|
||||
class LegacyEngineClient(FakeEngineClient):
|
||||
|
||||
Reference in new issue
Block a user