diff --git a/app/infrastructure/realtime.py b/app/infrastructure/realtime.py index 26d8849..de6ab90 100644 --- a/app/infrastructure/realtime.py +++ b/app/infrastructure/realtime.py @@ -198,7 +198,11 @@ class RealtimeAdapter: # Selected-profile probe: docs/guides/live-context-sync-repair.md. # The runtime separately requires the cancellation intent event_id, # terminal response confirmation, and heard-position truncation. - return (self.model in ("gpt-realtime-mini", "gpt-realtime-2.1") and self.voice == "shimmer" + return ((self.model, self.voice) in { + ("gpt-realtime-mini", "shimmer"), + ("gpt-realtime-2.1", "shimmer"), + ("gpt-realtime-2.1", "marin"), + } and isinstance(error, dict) and error.get("type") == "invalid_request_error" and error.get("code") == "response_cancel_not_active" diff --git a/docs/guides/live-context-sync-repair.md b/docs/guides/live-context-sync-repair.md index 532d106..c3d90ee 100644 --- a/docs/guides/live-context-sync-repair.md +++ b/docs/guides/live-context-sync-repair.md @@ -195,4 +195,22 @@ for `gpt-realtime-2.1/shimmer`. The adapter accepts this exact profile and signature alongside the previously probed `gpt-realtime-mini/shimmer`. Runtime event-ID, terminal response, and unheard-audio truncation gates remain mandatory. The incident observation is profile-specific evidence; this change -does not establish that cancellation acknowledgement deadlines are resolved. \ No newline at end of file +does not establish that cancellation acknowledgement deadlines are resolved. + +### Verified Marin cancellation race (2026-10-13) + +Operational session 79421770-4615-4140-ae2f-fc590510787d pinned +`gpt-realtime-2.1/marin`. Turn 7 cancellation was dispatched at elapsed 44499 ms; +completed terminal confirmation arrived at 44677 ms. The correlated error then +matched all three exact structured type/code/null-param guards but failed the +Shimmer-only profile guard, closing with CANCELLATION_PROVIDER_ERROR. +The verified profile set now additionally includes gpt-realtime-2.1/marin. +It does not admit other model/voice pairs or relax event-ID correlation, +terminal confirmation, final playback positions or truncation acknowledgement. +Synthetic regressions reproduce the original rejection, cover both terminal +orderings, and retain failure when terminal confirmation is absent. + +Verification: four new regression assertions failed before the fix; +114 focused synchronization, interruption and retained-search tests passed +afterward. A default-disabled trace test now isolates the operator .env. +Post-fix real microphone acceptance remains pending a fresh Marin session. diff --git a/docs/specifications/RAG-Phase1-API-Catalog.md b/docs/specifications/RAG-Phase1-API-Catalog.md index 1465432..9ba9b89 100644 --- a/docs/specifications/RAG-Phase1-API-Catalog.md +++ b/docs/specifications/RAG-Phase1-API-Catalog.md @@ -856,3 +856,17 @@ errors. Publication remains atomic, ready and inactive until selection. F01 capabilities add `allow_partial_extraction` and report effective review gates. Failed existing documents require a new upload to use this new frozen policy. Regression source: `tests/unit/test_partial_extraction.py`. + + +### Verified Marin cancellation race (2026-10-13) + +Operational session 79421770-4615-4140-ae2f-fc590510787d pinned +`gpt-realtime-2.1/marin`. Turn 7 cancellation was dispatched at elapsed 44499 ms; +completed terminal confirmation arrived at 44677 ms. The correlated error then +matched all three exact structured type/code/null-param guards but failed the +Shimmer-only profile guard, closing with CANCELLATION_PROVIDER_ERROR. +The verified profile set now additionally includes gpt-realtime-2.1/marin. +It does not admit other model/voice pairs or relax event-ID correlation, +terminal confirmation, final playback positions or truncation acknowledgement. +Synthetic regressions reproduce the original rejection, cover both terminal +orderings, and retain failure when terminal confirmation is absent. diff --git a/tests/unit/test_live_context_sync.py b/tests/unit/test_live_context_sync.py index 8fb513e..abf2054 100644 --- a/tests/unit/test_live_context_sync.py +++ b/tests/unit/test_live_context_sync.py @@ -11,7 +11,10 @@ from tests.unit.test_realtime_phase1 import ( from tests.unit.test_realtime_repairs import Clock, without_ticker -def test_numeric_timeline_is_disabled_by_default(runner, persisted, caplog): +def test_numeric_timeline_is_disabled_by_default(runner, persisted, caplog, monkeypatch, tmp_path): + # Default behavior must not depend on the operator's diagnostic .env. + monkeypatch.chdir(tmp_path) + monkeypatch.delenv("LIVE_DIAGNOSTIC_TRACE_ENABLED", raising=False) caplog.set_level(logging.INFO, logger="app.modules.voice.diagnostics") async def scenario(): runtime, transport, _ = await make(SimpleNamespace(engine=None), runner, persisted) @@ -229,12 +232,14 @@ CAPTURED_NO_ACTIVE = dict(type="invalid_request_error", @pytest.mark.parametrize("terminal_order", ["before_error", "after_error", "missing"]) -def test_captured_selected_profile_cancellation_race(runner, persisted, terminal_order): +@pytest.mark.parametrize("model,voice", [("gpt-realtime-mini", "shimmer"), ("gpt-realtime-2.1", "marin")]) +def test_captured_selected_profile_cancellation_race(runner, persisted, terminal_order, model, voice): async def scenario(): clock = Clock() runtime, transport, out = await make(SimpleNamespace(engine=None), runner, persisted, clock=clock) await without_ticker(runtime) + runtime.adapter.model, runtime.adapter.voice = model, voice try: await input_turn(runtime) await response(runtime, transport) @@ -351,6 +356,9 @@ def test_terminal_technical_failure_is_not_accepted_as_cancellation_race( @pytest.mark.parametrize("model,voice,accepted", [ ("gpt-realtime-mini", "shimmer", True), ("gpt-realtime-2.1", "shimmer", True), + ("gpt-realtime-2.1", "marin", True), + ("gpt-realtime-mini", "marin", False), + ("gpt-realtime-2.1", "cedar", False), ("gpt-realtime-2.1", "alloy", False), ("gpt-realtime-2.1-mini", "shimmer", False), ])