Skip to content

fix(azure-stt): handle canceled events and add cancellation tracing#4017

Open
oWretch wants to merge 3 commits intopipecat-ai:mainfrom
oWretch:feat/azure-stt-canceled-event
Open

fix(azure-stt): handle canceled events and add cancellation tracing#4017
oWretch wants to merge 3 commits intopipecat-ai:mainfrom
oWretch:feat/azure-stt-canceled-event

Conversation

@oWretch
Copy link

@oWretch oWretch commented Mar 13, 2026

Summary

  • Handle Azure STT recognizer cancellation and session lifecycle events so cancellations are surfaced through pipeline errors instead of failing silently.
  • Add cancellation tracing attributes (reason, code, recoverable, phase, and region) for improved observability of Azure STT failures.
  • Guard the STT audio path to stop accepting audio once recognition is terminated and wait for recognizer startup completion.
  • Add focused unit tests for startup handler wiring, canceled event error propagation, cancellation default handling, and post-termination audio dropping.
  • Include changelog fragments for both behavior changes and bug fixes (changelog/4017.changed.md, changelog/4017.fixed.md).

Testing

  • uv run pytest tests/test_azure_stt.py
  • uv run ruff check src/pipecat/services/azure/stt.py src/pipecat/utils/tracing/service_decorators.py tests/test_azure_stt.py

@oWretch oWretch marked this pull request as draft March 13, 2026 02:27
@oWretch oWretch force-pushed the feat/azure-stt-canceled-event branch from bdc6fa1 to d1e3916 Compare March 13, 2026 02:31
@oWretch oWretch marked this pull request as ready for review March 13, 2026 02:31
@oWretch oWretch force-pushed the feat/azure-stt-canceled-event branch from d1e3916 to 91aa4a6 Compare March 13, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant