Bug 1 (recorded call1): server-side cancel ended the voice SSE without a
terminal frame BEFORE the first delta (worker.log:108 SDK retry 13ms after
the text POST); the adapter raised a connection error, livekit-agents 1.8.8
silently retried the same turn_id, the retry re-acquired the gate, cancelled
the user's text turn and re-spoke a full ~32s reply. The HEL-907 claim that
the _retry_on_chunk_sent guard never worked is corrected: the guard only
applies after output (output_sent), verified against the installed SDK
source. Fix: explicit chat.cancelled terminal frame; a cancelled turn_id is
refused re-activation (never touches the newer active turn); the worker ends
cancelled turns on the SDK's own 499 path (no retry) and stops the cached
playout via SpeechHandle.interrupt(); a server_cancelled latch short-circuits
any re-entry with zero network. Failed-turn retries, completed-turn replay
and receipt validation are unchanged (dedicated tests).
Bug 2 (recorded row id=12): the endpoint streams implicit-open reasoning
plus a stray </think> inline in content into subtitles and TTS. Fix:
ReasoningSeparator at the OpenAI-compat adapter seam (cross-chunk safe,
reasoning_content field side-channel on LLMDelta.reasoning, never persisted)
plus a turn-level split before persist/final/receipt. Recorded stream
replays clean at every chunk size; normal zh/en content preserved
byte-for-byte; documented residual: implicit-open reasoning whose closer
lies beyond the 128-char hold streams partially (persistence stays clean).
Offline verification: .venv311 full suite 445 passed / 5 skipped (2
pre-existing test_r3 failures fail identically at 5625de6); real-SDK harness
(livekit-agents 1.8.8, agent venv) 5/5; reasoning separation 37/37; ruff
clean. Zero real requests, zero deployment, no dependency changes.
Co-authored-by: multica-agent <github@multica.ai>
16 lines
986 B
Plaintext
16 lines
986 B
Plaintext
|
|
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
|
=========================== short test summary info ============================
|
|
FAILED tests/test_r3.py::test_populated_migration_idempotence_and_old_code_rollback
|
|
FAILED tests/test_r3.py::test_three_endpoint_bytes_equal_product_baseline - s...
|
|
2 failed, 445 passed, 5 skipped, 1 warning in 51.70s
|
|
=== SDK harness (agent venv, livekit-agents 1.8.8) ===
|
|
failed to generate LLM completion: message='chat api failure: network is genuinely down', status_code=502, retryable=True, retrying in 0.1s
|
|
failed to generate LLM completion: message='chat api failure: network is genuinely down', status_code=502, retryable=True, retrying in 0.05s
|
|
PASS pre_first_delta_cancel_never_retries
|
|
PASS mid_stream_cancel_interrupts_handle_and_never_retries
|
|
PASS reentry_after_cancel_short_circuits_without_network
|
|
PASS real_connection_errors_still_retry_not_globally_disabled
|
|
PASS completed_turn_still_streams_with_receipt
|
|
5/5 passed
|