fix(#488): log voice adapter and ffmpeg disconnect failures at WARNING#556
fix(#488): log voice adapter and ffmpeg disconnect failures at WARNING#556drewdrewthis wants to merge 2 commits into
Conversation
Both except-pass blocks in _voice_disconnect_all() silently swallowed exceptions, violating the docstring's "failures are logged" contract. Each failure now emits a WARNING record with exc_info so operators can see transport-cleanup errors (e.g. Twilio voice_url restore failures, ffmpeg process hangs) without the scenario result being affected. Four new unit tests cover: disconnect failure logged, no propagation, ffmpeg stop failure logged, clean disconnect produces no warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
||
| import logging | ||
| import pytest | ||
| from typing import Any |
| import logging | ||
| import pytest | ||
| from typing import Any | ||
| from unittest.mock import MagicMock, AsyncMock, patch |
|
[grinder] READY for human review CI: green (zero failing, zero pending) Verified by: |
…onnect-failures # Conflicts: # python/scenario/scenario_executor.py
|
Automated low-risk assessment This PR was evaluated against the repository's Low-Risk Pull Requests procedure.
An approving review has been submitted by automation. The PR may merge once required CI checks pass. |
Summary
except Exception: passblocks in_voice_disconnect_all()withlogger.warning(..., exc_info=True)calls, honouring the existing docstring contract: "failures are logged but do not mask the primary scenario result."WARNING: voice adapter {ClassName} disconnect failedwith full traceback.WARNING: ffmpeg playback stop failedwith full traceback.Acceptance criteria (from #488)
_voice_disconnect_alllogs every caught exception vialogger.warning("voice adapter %s disconnect failed", agent_name, exc_info=True).stop()swallow also logs (logger.warning("ffmpeg playback stop failed", exc_info=True))exc_infoattached_voice_disconnect_all:750-751remains accurate (unchanged; logging now matches the documented intent)Test plan
pytest tests/test_voice_disconnect_logging.py -v— 4 tests, all greenpytest tests/ -m "not integration"— no regressionspyright .— 0 errors🤖 Generated with Claude Code